Re: BUG #2069: Cursors are not close outside of a function

From: Jaime Casanova <systemguards(at)gmail(dot)com>
To: Hubert FONGARNAND <h(dot)fongarnand(at)fiducial(dot)fr>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2069: Cursors are not close outside of a function
Date: 2005-11-25 15:58:55
Message-ID: c2d9e70e0511250758p31551653g36a570234be8d613@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 11/24/05, Hubert FONGARNAND <h(dot)fongarnand(at)fiducial(dot)fr> wrote:
> Note that i don't close c1 after returning...
> (c1 should be close automatically because it is declared inside my
> function);
>

From 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

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
by the caller, or it will be closed automatically when the transaction closes.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

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 ;)

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Keith Randall 2005-11-25 16:13:55 BUG #2072: CPPFLAGS clobbered
Previous Message Tom Lane 2005-11-25 15:35:43 Re: BUG #2069: Cursors are not close outside of a function