Postgresql Use Variable From Another Method