Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-hackers by date

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

pgsql-general by date

Next:From: Tom LaneDate: 2007-03-02 01:16:29
Subject: Re: Constraint validation
Previous:From: mobiledreamersDate: 2007-03-02 01:04:36
Subject: Re: US Highschool database in postgres

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group