From: Paul Lindner <lindner@inuus.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pg@fastcrypt.com
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Heikki Linnakangas <heikki@enterprisedb.com>
Cc: lindner@inuus.com
Cc: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Prepared Statements vs. pgbouncer
Date: Mon, 1 Oct 2007 14:09:22 -0700
Message-ID: <20071001210922.GQ3140@inuus.com> (raw)
In-Reply-To: <19675.1191264250@sss.pgh.pa.us>
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>
On Mon, Oct 01, 2007 at 02:44:10PM -0400, Tom Lane wrote:
> Dave Cramer <pg@fastcrypt.com> writes:
> > Josh Berkus wrote:
> >> So where is it going to be easier to fix this ... pgBouncer, or pg-JDBC?
>
> > pgBouncer is broken so I'd fix it.
>
> 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=true;
Of course this doesn't help for dynamically prepared statements, which
has been my problem all along...
--
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, tgl@sss.pgh.pa.us, pg@fastcrypt.com, josh@agliodbs.com, heikki@enterprisedb.com, oliver@opencloud.com
Subject: Re: Prepared Statements vs. pgbouncer
In-Reply-To: <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> <20071001210922.GQ3140@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