Re: PL/pgSQL EXECUTE '..' USING with unknown - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PL/pgSQL EXECUTE '..' USING with unknown
Date
Msg-id 3517.1281046409@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/pgSQL EXECUTE '..' USING with unknown  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: PL/pgSQL EXECUTE '..' USING with unknown  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: PL/pgSQL EXECUTE '..' USING with unknown  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> On 08/05/2010 05:11 PM, Tom Lane wrote:
>> This example doesn't seem terribly compelling.  Why would you bother
>> using USING with constants?

> In a more complex example you might use $1 in more than one place in the 
> query.

Well, that's better than no justification, but it's still pretty weak.
A bigger problem is that doing anything like this will require reversing
the logical path of causation in EXECUTE USING.  Right now, we evaluate
the USING expressions first, and then their types feed forward into
parsing the EXECUTE string.  What Heikki is suggesting requires
reversing that, at least to some extent.  I'm not convinced it's
possible without breaking other cases that are more important.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Florian Pflug
Date:
Subject: Re: Patch to show individual statement latencies in pgbench output
Next
From: Josh Berkus
Date:
Subject: Re: Concurrent MERGE