Re: BUG #2069: Cursors are not close outside of a function - Mailing list pgsql-bugs

From Jaime Casanova
Subject Re: BUG #2069: Cursors are not close outside of a function
Date
Msg-id c2d9e70e0511250758p31551653g36a570234be8d613@mail.gmail.com
Whole thread Raw
In response to BUG #2069: Cursors are not close outside of a function  ("Hubert FONGARNAND" <h.fongarnand@fiducial.fr>)
List pgsql-bugs
On 11/24/05, Hubert FONGARNAND <h.fongarnand@fiducial.fr> wrote:
> Note that i don't close c1 after returning...
> (c1 should be close automatically because it is declared inside my
> function);
>

=46rom the manual (signs are mine)...

35.8.3.3. Returning Cursors
PL/pgSQL functions can return cursors to the caller. This is useful to
return multiple rows or columns, especially with very large result
sets. To do this, the function opens the cursor and returns the cursor
name to the caller (or simply opens the cursor using a portal name
specified by or otherwise known to the caller). The caller can then
fetch rows from the cursor. The cursor can be closed
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
by the caller, or it will be closed automatically when the transaction clos=
es.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^=
^^^^^^^^^^^^

-----------------------------------

This is the behaviour i see in informix (i dunno for other major
databases)... Cursors closes at end of transaction or by the user...



--
Atentamente,
Jaime Casanova
(DBA: DataBase Aniquilator ;)

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2069: Cursors are not close outside of a function
Next
From: Bruce Momjian
Date:
Subject: Re: BUG #2052: Federal Agency Tech Hub Refuses to Accept