Postgres Set Variable Before Query