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

Re: Fun with Cursors- how to rewind a cursor

From: "Postgres User" <postgres(dot)developer(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fun with Cursors- how to rewind a cursor
Date: 2007-03-02 06:04:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-hackers
I had tried several variations of MOVE Backward inside an Execute
statement earlier.  And now, I'm seeing this error appear again:

ERROR: 0A000: cannot manipulate cursors directly in PL/pgSQL

I updated the Postgres function below with this replacement line:
Execute 'MOVE Backward All In c_entry';

Any other thoughts?

On 3/1/07, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Postgres User" <postgres(dot)developer(at)gmail(dot)com> writes:
> > So I added the following code:
> > <before opening cursor>     ref_entry = 'c_entry';
> > <after looping thru cursor>  MOVE Backward All In c_entry;
> You have to use EXECUTE for the latter.
>                        regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tatsuo IshiiDate: 2007-03-02 06:06:39
Subject: Re: broken doc
Previous:From: Tom LaneDate: 2007-03-02 06:02:41
Subject: Re: broken doc

pgsql-general by date

Next:From: Postgres UserDate: 2007-03-02 06:20:40
Subject: Re: Add items to a record variable
Previous:From: Tom LaneDate: 2007-03-02 05:33:44
Subject: Re: Fun with Cursors- how to rewind a cursor

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