Postgresql Function Set Variable In T Sql Cursor Example