Re: [HACKERS] [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-25 Thread Tom Lane
I wrote: > I'd venture that we should try to get rid of the restriction, but I'm > unsure whether removing the error check is sufficient or whether there > are real problems it's preventing. I did a little experimentation and it seems that DECLARE CURSOR, FETCH, and CLOSE work perfectly fine when

Re: [HACKERS] [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-25 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Hm, you're right. This arises from the fact that _SPI_execute_plan >> rejects cursor-related utility statements. While I'd never stopped >> to question that before, it does seem like this restriction is a >> bit pointless. Does anyon

Re: [HACKERS] [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-24 Thread Bruce Momjian
Tom Lane wrote: > "Postgres User" <[EMAIL PROTECTED]> writes: > > On 3/1/07, Tom Lane <[EMAIL PROTECTED]> wrote: > >> "Postgres User" <[EMAIL PROTECTED]> writes: > >>> ref_entry = 'c_entry'; > >>> MOVE Backward All In c_entry; > >> > >> You have to use EXECUTE for the latter. > > > I had t

Re: [HACKERS] [GENERAL] Fun with Cursors- how to rewind a cursor

2007-03-01 Thread Tom Lane
"Postgres User" <[EMAIL PROTECTED]> writes: > On 3/1/07, Tom Lane <[EMAIL PROTECTED]> wrote: >> "Postgres User" <[EMAIL PROTECTED]> writes: >>> ref_entry = 'c_entry'; >>> MOVE Backward All In c_entry; >> >> You have to use EXECUTE for the latter. > I had tried several variations of MOVE Ba