Postgresql Using Variables In Queries In Attribute