Sql Server Function Declare Variable Postgresql