Postgresql Use Variable In Query Which Filter