Postgres Sql Using Variable In Query