Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1E0FF9FA2B5 for ; Mon, 1 Oct 2007 18:11:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 73543-01 for ; Mon, 1 Oct 2007 18:11:26 -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 1B2F79FA340 for ; Mon, 1 Oct 2007 18:11:28 -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 l91L9MgY014379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Oct 2007 14:09:22 -0700 Received: (from lindner@localhost) by mirth.inuus.com (8.14.1/8.14.1/Submit) id l91L9MhU014378; Mon, 1 Oct 2007 14:09:22 -0700 X-Authentication-Warning: mirth.inuus.com: lindner set sender to lindner@inuus.com using -f Date: Mon, 1 Oct 2007 14:09:22 -0700 From: Paul Lindner To: Tom Lane Cc: pg@fastcrypt.com, Josh Berkus , Heikki Linnakangas , lindner@inuus.com, Oliver Jowett , pgsql-jdbc@postgresql.org Subject: Re: Prepared Statements vs. pgbouncer Message-ID: <20071001210922.GQ3140@inuus.com> References: <24584.1191033096@sss.pgh.pa.us> <20070929072159.GI3140@inuus.com> <46FE3B1A.7020603@agliodbs.com> <46FED7FA.6060309@opencloud.com> <46FFC314.5080205@agliodbs.com> <47000C2E.8030409@opencloud.com> <4700B21C.1000008@enterprisedb.com> <47013A0E.6080607@agliodbs.com> <47013E0F.8050508@fastcrypt.com> <19675.1191264250@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LqInKle6vr1NBc7W" Content-Disposition: inline In-Reply-To: <19675.1191264250@sss.pgh.pa.us> 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/27 X-Sequence-Number: 17599 --LqInKle6vr1NBc7W Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 01, 2007 at 02:44:10PM -0400, Tom Lane wrote: > Dave Cramer writes: > > Josh Berkus wrote: > >> So where is it going to be easier to fix this ... pgBouncer, or pg-JDB= C? >=20 > > pgBouncer is broken so I'd fix it. >=20 > It's an enormous mistake to imagine that prepared statements are the > only issue. What about GUC settings and temp tables, to mention a > couple other bits of per-session state? What if you're in a homogenous environment and can control those variables? Or for another example, what if you want to create a pool of read-only replicas and don't care which server gets the request. What about failover situations? With stateless clients and the correct pooling one could seamlessly send requests to a durable Connection, avoiding a large amount of retry logic in the individual code. Perl's adage "Make easy things easy and hard things possible" is apropos here.. ---------------------------------------------------------------------- In fact, here's a crazy idea: static pre-defined session state tied to roles: ALTER ROLE appserver_v1 PREPARE foo() AS ....; ALTER ROLE appserver_v1 PREPARE xyz() AS ....; ALTER ROLE appserver_v1 SET SESSION stateless=3Dtrue; Of course this doesn't help for dynamically prepared statements, which has been my problem all along... --=20 Paul Lindner ||||| | | | | | | | | | lindner@inuus.com --LqInKle6vr1NBc7W Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFHAWIB+FkoUnP1gFQRAkeeAJ97kRcYp1dRVwJ9I/GQSyxNY4b/yACgpaKV VGYXCDUgE3paJYVyYiwyS5w= =3MGM -----END PGP SIGNATURE----- --LqInKle6vr1NBc7W--