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

From Neil Conway
Subject Re: TODO item: list prepared queries
Date
Msg-id 43BADFF9.9020105@samurai.com
Whole thread Raw
In response to Re: TODO item: list prepared queries  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: TODO item: list prepared queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> The average application that wants to use this view at all will be
> looking to see "did I already prepare FOO".  If it's using the query
> definition string for this purpose, comparing source text is easy
> while comparing deparsed text to source is a nightmare.

Well, I don't see why an application would want to look at the query
string in the first place -- as you pointed out earlier, using the
prepared statement's name seems a much easier way to identify prepared
statements.

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.

-Neil

pgsql-patches by date:

Previous
From: Joe Conway
Date:
Subject: Re: [BUGS] BUG #2129: dblink problem
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #2129: dblink problem