Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9812E9FA168 for ; Mon, 1 Oct 2007 18:55:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 42608-05 for ; Mon, 1 Oct 2007 18:55:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mirth.inuus.com (mirth.inuus.com [67.100.95.85]) by postgresql.org (Postfix) with ESMTP id 5502C9FA06E for ; Mon, 1 Oct 2007 18:55:33 -0300 (ADT) Received: from mirth.inuus.com (localhost.localdomain [127.0.0.1]) by mirth.inuus.com (8.14.1/8.14.1) with ESMTP id l91LtBnh016301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Oct 2007 14:55:11 -0700 Received: (from lindner@localhost) by mirth.inuus.com (8.14.1/8.14.1/Submit) id l91LtBht016300; Mon, 1 Oct 2007 14:55:11 -0700 X-Authentication-Warning: mirth.inuus.com: lindner set sender to lindner@inuus.com using -f Date: Mon, 1 Oct 2007 14:55:11 -0700 From: Paul Lindner To: Oliver Jowett Cc: Paul Lindner , Josh Berkus , Heikki Linnakangas , pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer Message-ID: <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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Sr/1Pkwuhjf1+ztR" Content-Disposition: inline In-Reply-To: <4701647C.8050305@opencloud.com> User-Agent: Mutt/1.5.14 (2007-02-12) X-Virus-Scanned: ClamAV 0.91.2/4445/Mon Oct 1 01:32:46 2007 on mirth.inuus.com X-Virus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/32 X-Sequence-Number: 17604 --Sr/1Pkwuhjf1+ztR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > To elaborate a bit more: you need a statement before you can create a=20 > portal, and the unnamed statement is no use for this particular case as= =20 > we need the portal to live despite reuse of the unnamed statement, and=20 > the implicit close of the unnamed statement on reuse also causes any=20 > dependant portal to close. So we must use a named statement so that we=20 > can control the lifetime of the portal correctly. Okay, Okay, I have read much of=20 http://www.postgresql.org/docs/current/static/protocol.html and much of src/backend/tcop/postgres.c and much of=20 src/backend/commands/portalcmds.c I'm a newbie here, but it appears that PerformCursorOpen() is callable =66rom the SQL grammar, not directly via the protocol. My apologies for mixing up PL/PGSQL and V3 protocol. --=20 Paul Lindner ||||| | | | | | | | | | lindner@inuus.com --Sr/1Pkwuhjf1+ztR Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFHAWy5+FkoUnP1gFQRAjvlAJ0bqSe78cbvyizdp4Zk4iGCbCjqAgCfR0zh lGcjcAyb/qYZQ8QNHxLyaWE= =Fu0p -----END PGP SIGNATURE----- --Sr/1Pkwuhjf1+ztR--