Postgresql Use Variable In Query Criteria