Postgresql Using Variables In Queries