Re: TODO item: list prepared queries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Paesold" <mpaesold(at)gmx(dot)at>
Cc: "Neil Conway" <neilc(at)samurai(dot)com>, "Joachim Wieland" <joe(at)mcknight(dot)de>, pgsql-patches(at)postgresql(dot)org
Subject: Re: TODO item: list prepared queries
Date: 2005-12-14 15:58:00
Message-ID: 19889.1134575880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Michael Paesold" <mpaesold(at)gmx(dot)at> writes:
> Tom Lane wrote:
>> BTW, pursuant to comments about David's proposal just now --- why is the
>> patch using text at all, rather than reverse-compiling the prepared
>> statement's querytree?

> Well, I think for the driver or application, to recognize queries as their
> own, it seems much easier if the query is given exaclty as it was sent.

Depends on what the intended use of the view is, I suppose --- but I
should think that drivers would tend to just look at the statement name
to decide if it's something they sent, rather than comparing the text
of the body. Showing a reverse-compiled version would be more robust
in the face of cases like a subsequent change of schema search path,
RENAME commands, etc.

Also, while I have not looked at the patch to see where it's getting
the "original text" from, I'll bet lunch that it's wrong. The structure
of the parser doesn't permit easy extraction of the original text
corresponding to just one SQL command.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Ben Gould 2005-12-14 16:45:22 BUG #2114: (patch) COPY FROM ... end of copy marker corrupt
Previous Message Michael Paesold 2005-12-14 07:40:16 Re: TODO item: list prepared queries