Re: WITH HOLD and pooled connections - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: WITH HOLD and pooled connections
Date
Msg-id 200308082101.h78L1sK21611@candle.pha.pa.us
Whole thread Raw
In response to Re: WITH HOLD and pooled connections  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > What would be interesting is a CREATE OR REPLACE functionality for
> > prepared cursors, where you could ask for it to be prepared, but if it
> > already existed, it would do nothing, or something like that.
> 
> I don't think you could call that CREATE OR REPLACE, because (if it's
> supposed to be efficient) it *wouldn't* replace.  In any case I think
> apps would prefer to avoid the overhead of even issuing such a command.
> If you approach it that way, you're adding some number of additional
> SQL commands to each pooled transaction, which seems to defeat the
> purpose of pre-preparing commands.

Of course, it wouldn't be called "CREATE OR REPLACE" but something like
that, or a flag to PREPARE.

I assume the prepare overhead is much higher than a single query parse.
How would you get the info without issuing a command to get it.  You
could get it via some protocol request, but that seems pretty hard to
manage from libpq up to your interface, and is the extra effort worth
avoiding sending a query?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: new psql \d command
Next
From: Bruno Wolff III
Date:
Subject: contrib/vacuumlo problem in cvs