Re: TODO item: list prepared queries - Mailing list pgsql-patches

From Tom Lane
Subject Re: TODO item: list prepared queries
Date
Msg-id 19695.1136321224@sss.pgh.pa.us
Whole thread Raw
In response to Re: TODO item: list prepared queries  (Neil Conway <neilc@samurai.com>)
Responses Re: TODO item: list prepared queries  (Neil Conway <neilc@samurai.com>)
List pgsql-patches
Neil Conway <neilc@samurai.com> writes:
> In any case, if we use the query string as supplied by the user, how do
> we produce that string in the case of SQL PREPARE? Manually stripping a
> "PREPARE ... AS" prefix from the query string is difficult to do
> robustly, but it seems  (a) expensive (b) inconsistent to deparse the
> Query for SQL PREPARE but not for Parse messages. We could just include
> the "PREPARE ... AS" prefix for SQL PREPAREs, but that seems ugly.

I don't see the problem.  Defining the view field as "the string sent to
the server to create the prepared statement" seems perfectly consistent
to me.

In practice, any given application will probably use one method to the
exclusion of the other, and wouldn't notice the "inconsistency" anyway.
If you are using both methods of preparing statements for some reason,
it's not improbable that you would want to know which way a given
statement was created, and seeing the PREPARE in there would be a useful
cue.

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #2129: dblink problem
Next
From: Neil Conway
Date:
Subject: Re: TODO item: list prepared queries