Re: Prepared Statements vs. pgbouncer

Поиск
Список
Период
Сортировка
От Paul Lindner
Тема Re: Prepared Statements vs. pgbouncer
Дата
Msg-id 20071001215511.GS3140@inuus.com
обсуждение исходный текст
Ответ на Re: Prepared Statements vs. pgbouncer  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
On Tue, Oct 02, 2007 at 10:19:56AM +1300, Oliver Jowett wrote:
> Oliver Jowett wrote:
> >Paul Lindner wrote:
> >
> >>Why doesn't the Postgres JDBC driver use cursors for ResultSets
> >>instead of creating prepared statements?  Is this not supported in the
> >>v3 protocol?  (I'd answer this question myself, but no time to read
> >>code at the moment...)
> >
> >It uses portals which are the v3 equivalent of cursors.
>
> To elaborate a bit more: you need a statement before you can create a
> portal, and the unnamed statement is no use for this particular case as
> we need the portal to live despite reuse of the unnamed statement, and
> the implicit close of the unnamed statement on reuse also causes any
> dependant portal to close. So we must use a named statement so that we
> can control the lifetime of the portal correctly.

Okay, Okay, I have read much of

  http://www.postgresql.org/docs/current/static/protocol.html

and much of

  src/backend/tcop/postgres.c

and much of

  src/backend/commands/portalcmds.c

I'm a newbie here, but it appears that PerformCursorOpen() is callable
from the SQL grammar, not directly via the protocol.

My apologies for mixing up PL/PGSQL and V3 protocol.


--
Paul Lindner        ||||| | | | |  |  |  |   |   |
lindner@inuus.com

Вложения

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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Prepared Statements vs. pgbouncer
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Prepared Statements vs. pgbouncer