From: Paul Lindner <lindner@inuus.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Paul Lindner <lindner@inuus.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Prepared Statements vs. pgbouncer
Date: Mon, 1 Oct 2007 14:55:11 -0700
Message-ID: <20071001215511.GS3140@inuus.com> (raw)
In-Reply-To: <4701647C.8050305@opencloud.com>
References: <24584.1191033096@sss.pgh.pa.us>
<4701402A.2020804@agliodbs.com>
<20071001193153.GN3140@inuus.com>
<200710011249.19142.josh@agliodbs.com>
<20071001203432.GO3140@inuus.com>
<470160C0.6020907@opencloud.com>
<4701647C.8050305@opencloud.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: lindner@inuus.com, oliver@opencloud.com, josh@agliodbs.com, heikki@enterprisedb.com
Subject: Re: Prepared Statements vs. pgbouncer
In-Reply-To: <20071001215511.GS3140@inuus.com>
References: <24584.1191033096@sss.pgh.pa.us> <4701402A.2020804@agliodbs.com> <20071001193153.GN3140@inuus.com> <200710011249.19142.josh@agliodbs.com> <20071001203432.GO3140@inuus.com> <470160C0.6020907@opencloud.com> <4701647C.8050305@opencloud.com> <20071001215511.GS3140@inuus.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox