Postgres Use Variable Outside Function Javascript W3schools