Thread: PL/pgSQL & Cursors

PL/pgSQL & Cursors

From
"Dwelle, Timothy"
Date:
I have been playing around with the PL/pgSQL stuff, and I have
been having trouble getting cursors to work inside my PL/pgSQL
functions.  Reading through the documentation, I see that:

(1) cursors must occur inside a transaction, and
(2) PL/pgSQL functions cannot start or end a transaction

Does this mean there is no way to use cursors inside a
PL/pgSQL function?

Any help would be appreciated.


Re: PL/pgSQL & Cursors

From
wieck@debis.com (Jan Wieck)
Date:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I have been playing around with the PL/pgSQL stuff, and I have
> been having trouble getting cursors to work inside my PL/pgSQL
> functions.  Reading through the documentation, I see that:
>
> (1) cursors must occur inside a transaction, and
> (2) PL/pgSQL functions cannot start or end a transaction
   Maybe  it's  only the parser of PL/pgSQL. But AFAIK there are   also problems with using  named  portals  over  SPI
(what a   cursor is).
 
   There  are other things I want to do on PL/pgSQL after 7.0 is   out.  So I'll give it a try then.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #