On 14/10/11 15:22, thomas veymont wrote:
> thanks for your helpful answers.
>
>>> >> mycursor.execute ( "fetch mycursor" )
> is working okay.
>
> you are right : using the psycopg native support for cursors makes
> clearer code. But, yes indeed, the pgsql function is somewhat a
> mandatory API to the database, so the Python code doesn't have to know
> the inner query structure.
>
> Daniele, beside the hack you are providing, you say : "all cursors
> from the same connections live in the same transaction"
> => is it something specific that is true today but may change in the
> future ? I mean, may I rely on this for a long-living code ?
Yes. Cursors are (and always be, we care about forward compatibility)
WITHOUT HOLD, so they live inside the current transaction only (unless
you pass the withhold parameter, that's it.)
federico
--
Federico Di Gregorio fog@initd.org
Ahr ahr ahr! E mo' me'e magno tutte! -- Er bieco