Sql Server Function Declare Variable Postgresql Database