Postgresql Use Variable In Query Definition