From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gerhard Häring <lists@ghaering.de>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: I want to send comments to the backend!
Date: Thu, 20 Mar 2003 13:48:41 -0500 (EST)
Message-ID: <200303201848.h2KImfn29586@candle.pha.pa.us> (raw)
In-Reply-To: <25054.1048185788@sss.pgh.pa.us>
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Could we change the backend to return NullCommand() if the query string
> > was empty, rather than checking for whitespace directly? I thought the
> > whitespace test was there only as a performance hack.
>
> It's not a performance hack; it's a performance loss, because 99.99999%
> of the time the strspn test is wasted. Don't tell me that empty queries
> are an important case to optimize ;-).
>
> The only reason that code is still there is that old versions of libpq
> used to need to see a special NullCommand response when they
> deliberately sent empty queries (which IIRC they used to do for NOTIFY
> checks, many years ago before the backend would send NOTIFYs
> unprompted). I'd prefer to take NullCommand out of the protocol, not
Right. I am sure it was for that.
> generalize it to understand about comments. Right now seems to be a
> fine time to think about this, in fact, given that we're hacking the
> protocol anyway.
Yes.
> If we were only dealing with libpq, I think I'd take that code out of
> the backend and modify PQexec to produce a PGRES_EMPTY_QUERY on getting
> only ReadyForQuery from the backend. I'm not sure whether JDBC or ODBC
> might care about NullCommand responses, though --- anyone know?
--
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, Pennsylvania 19073
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: pgman@candle.pha.pa.us, tgl@sss.pgh.pa.us, lists@ghaering.de
Subject: Re: I want to send comments to the backend!
In-Reply-To: <200303201848.h2KImfn29586@candle.pha.pa.us>
* 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