Re: Fun with Cursors- how to rewind a cursor

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Postgres User" <postgres(dot)developer(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fun with Cursors- how to rewind a cursor
Date: 2007-03-02 01:04:52
Message-ID: 28067.1172797492@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Postgres User" <postgres(dot)developer(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-03-02 01:16:29 Re: Constraint validation
Previous Message mobiledreamers 2007-03-02 01:04:36 Re: US Highschool database in postgres

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-03-02 01:08:32 Re: SOC & user quotas
Previous Message Sergey E. Koposov 2007-03-02 00:31:44 Re: SOC & user quotas