Postgres Declare Cursor Example