Re: EXECUTE USING for plpgsql (for 8.4)

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: EXECUTE USING for plpgsql (for 8.4)
Date: 2007-10-23 12:52:17
Message-ID: 162867790710230552p30a6eb0bp56669046c9c780c4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

>
> This doesn't work:
>
> create function exc_using(varchar) returns varchar
> as $$
> declare v varchar;
> begin
> execute 'select upper($1)' into v using ('aa');

it cannot work. Your parameter is row. But
into v using 'aaa' doesn't work too :(

ERROR: failed to find conversion function from unknown to text
CONTEXT: SQL statement "select upper($1)"

you have to specify type: use argument, variable or casting
.... using text 'aaa'; or select upper($1::text)

It is question for Tom. Why prepared statement cannot cast from literal to text
http://www.nabble.com/Blowback-from-text-conversion-changes-t3977711.html

>
> I also noted that the patch makes USING a keyword. Not sure if we care
> about that or not.
>
I am afraid to change well know syntax (SQL/PSM use it in same context too).

Pavel

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Gokulakannan Somasundaram 2007-10-23 13:06:25 Re: [PATCHES] Including Snapshot Info with Indexes
Previous Message Hannu Krosing 2007-10-23 12:40:33 Re: [PATCHES] Including Snapshot Info with Indexes