Re: Perl y Cursores

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Patricio Muñoz <adivisi(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Perl y Cursores
Date: 2007-10-03 22:22:57
Message-ID: 20071003222257.GE24827@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Patricio Muñoz escribió:
> Estimados,
> Alguien sabe si es posible utilizar cursores desde Perl utilizando dbi ?
>
> Según la documentacion del modulo DBD:Pg, aparece una seccion dedicada a
> cursores, la expongo
>
> Cursors
> <http://search.cpan.org/%7Edbdpg/DBD-Pg-1.49/Pg.pm#___top>
>
> "Although PostgreSQL has a cursor concept, it has not been used in the
> current implementation. Cursors in PostgreSQL can only be used inside a
> transaction block. Because only one transaction block at a time is allowed,
> this would have implied the restriction not to use any nested
> SELECTstatements. Hence the
> execute method fetches all data at once into data structures located in the
> front-end application. This approach must to be considered when selecting
> large amounts of data!"
> Según lo que lei y entendi no es soportado ?

No directamente, pero hasta donde veo, puedes desactivar AutoCommit y
luego usar DECLARE y FETCH para manipular los cursores directamente.
Observa que tienes que abrir una transaccion primero, y terminarla
despues de agotar el cursor.

--
Alvaro Herrera Valdivia, Chile ICBM: S 39º 49' 18.1", W 73º 13' 56.4"
"Lo esencial es invisible para los ojos" (A. de Saint Exúpery)

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fevis Koste 2007-10-03 23:17:16 Subir postgres de forma automática en SUSE 10 Sles
Previous Message Alvaro Herrera 2007-10-03 21:37:41 Re: Sobre espejado de Bases de datos