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: b88c3460703012204p2c3b101ft8af105526aa0210d@mail.gmail.com (view raw or flat)
Thread:
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

Responses

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-2014 The PostgreSQL Global Development Group