Postgres Set Variable In T Sql Declare Cursor