Postgres Use Variable From Another Method