Postgresql Function Set Variable Sql