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