Re: using server side cursor

Поиск
Список
Период
Сортировка
От Federico Di Gregorio
Тема Re: using server side cursor
Дата
Msg-id 4E983C16.9080203@dndg.it
обсуждение исходный текст
Ответ на Re: using server side cursor  (thomas veymont <thomas.veymont@gmail.com>)
Список psycopg
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

В списке psycopg по дате отправления:

Предыдущее
От: thomas veymont
Дата:
Сообщение: Re: using server side cursor
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: using server side cursor