Search Postgresql Archives

Re: R: Re: Weird EXECUTE ... USING behaviour

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 12 January 2010 9:38:06 pm Vincenzo Romano wrote:
> The static binding worked fine in the second EXECUTE USING statement but
> not in the first one.
> I still think that it's weird more than wishful.
> I can work it around, though.
>
> Il giorno 12 gen, 2010 4:13 p., "Tom Lane" <tgl@xxxxxxxxxxxxx> ha scritto:
>
> Vincenzo Romano <vincenzo.romano@xxxxxxxxxxx> writes:
> > I don't think so. Those variables should be evaluated with the USING >
>
> *before* the actual executi...
> Unfortunately, that's just wishful thinking, not how EXECUTE USING
> actually works.
>
>                        regards, tom lane

Without the whole function it is hard to say. Given the error I would say it is 
a quoting issue. The table name is being substituted for, the other parameters 
are not. It acts like the add_check clause is not part of the EXECUTE statement 
and is just being passed through verbatim.

ERROR:  there is no parameter $1
CONTEXT: SQL statement "
              alter table public.test_part_2 add check(
data>=$1::timestamp and data<$2::timestamp and maga=$3 )

 
-- 
Adrian Klaver
adrian.klaver@xxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux