Re: Interfaces that support cursors

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Interfaces that support cursors
Дата
Msg-id m34qyhavfa.fsf@varsoon.wireboard.com
обсуждение исходный текст
Ответ на Interfaces that support cursors  (Network Administrator <netadmin@vcsn.com>)
Ответы Re: Interfaces that support cursors  (Network Administrator <netadmin@vcsn.com>)
Список pgsql-general
Network Administrator <netadmin@vcsn.com> writes:

> I've got a Pg 7.1.3 release that I'm going to upgrade to 7.4 but in the meantime
> I wanted to know if Pg.pm (or DBD:Pg) supported using cursors.  I would guess
> that they they don't because from what I understand every executed query in this
> interface is implicitly wrapped in a transaction (thus there is an implicit
> commit that would close the cursor).

I haven't used Pg.pm, but DBD::Pg has an "autocommit" flag when
creating a new connection, to control this behavior.  If you turn off
autocommit, you can use DECLARE to create a cursor and FETCH to get
rows from it, just as with any other interface, as long as your
transaction is open.

The DBI and DBD::Pg docs describe everything pretty well.

-Doug

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

Предыдущее
От: Network Administrator
Дата:
Сообщение: Interfaces that support cursors
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Replication Bundled with Main Source.