Re: Prepared Statements vs. pgbouncer

From: Paul Lindner <lindner(at)inuus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pg(at)fastcrypt(dot)com, Josh Berkus <josh(at)agliodbs(dot)com>, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, lindner(at)inuus(dot)com, Oliver Jowett <oliver(at)opencloud(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Prepared Statements vs. pgbouncer
Date: 2007-10-01 21:09:22
Message-ID: 20071001210922.GQ3140@inuus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, Oct 01, 2007 at 02:44:10PM -0400, Tom Lane wrote:
> Dave Cramer <pg(at)fastcrypt(dot)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(at)inuus(dot)com

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2007-10-01 21:19:56 Re: Prepared Statements vs. pgbouncer
Previous Message Oliver Jowett 2007-10-01 21:06:50 Re: Prepared Statements vs. pgbouncer