"Postgres User" <postgres.developer@xxxxxxxxx> writes: > Is there any way to 'rewind' the cursor to the first row? plpgsql doesn't have any command for that (though I think someone is working on improving its cursor command set). You should be able to work around it by EXECUTE'ing a MOVE BACKWARD ALL command, though. You just need to know the real name of the cursor --- see 'Returning Cursors' in the plpgsql docs for discussion. regards, tom lane