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

From Andrew Dunstan
Subject Re: PL/pgSQL EXECUTE '..' USING with unknown
Date
Msg-id 4C5B2DC5.2030804@dunslane.net
Whole thread Raw
In response to Re: PL/pgSQL EXECUTE '..' USING with unknown  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: PL/pgSQL EXECUTE '..' USING with unknown  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 08/05/2010 05:11 PM, Tom Lane wrote:
> Heikki Linnakangas<heikki.linnakangas@enterprisedb.com>  writes:
>> There's a little problem with EXECUTE USING when the parameters are of
>> type unknown (going back to 8.4 where EXECUTE USING was introduced):
>> do $$
>> BEGIN
>>     EXECUTE 'SELECT to_date($1, $2)' USING '17-DEC-80', 'DD-MON-YY';
>> END;
>> $$;
>> ERROR:  failed to find conversion function from unknown to text
> 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.

cheers

andrew


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/pgSQL EXECUTE '..' USING with unknown
Next
From: Florian Pflug
Date:
Subject: Re: Patch to show individual statement latencies in pgbench output