Re: Allow pooled connections to list all prepared queries - Mailing list pgsql-patches

From Kris Jurka
Subject Re: Allow pooled connections to list all prepared queries
Date
Msg-id Pine.BSO.4.56.0412271253540.992@leary.csoft.net
Whole thread Raw
In response to Allow pooled connections to list all prepared queries  (David Brown <dave@spoonguard.org>)
Responses Re: Allow pooled connections to list all prepared queries
List pgsql-patches

On Sat, 25 Dec 2004, David Brown wrote:

> You're right, in the case of standalone Perl or Apache::DBI. However, if
> DBD::Pg happens to grab an already-open connection that doesn't have a
> one-to-one correspondence with a $dbh (e.g. from a Postgres connection pool,
> or from an external pooling server like DBBalancer[1]), the state of the
> connection (with respect to past PREPAREs) isn't known.
>

I'm not clear why the pooling case is different.  Speaking from the JDBC
side (which does connection pooling, but not statement pooling) there is
a proxy connection object which wraps a real connection.  So each new
connection from the pool gets a new proxy object, but the real underlying
connection stays the same.  So the real connection will know what it has
or has not prepared.  So I don't see why, simply because it's in a pool,
that it forgets what's been prepared.

Kris Jurka

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Fix oldstyle_length regression test for netbsd-mac68k
Next
From: Mark Kirkwood
Date:
Subject: Another Plpgsql trigger example - summary table