Search Postgresql Archives

Weird EXECUTE ... USING behaviour

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

 



In a PL/PgSQL function I have the following:

----
            execute $l2$
              alter table $l2$||ct||$l2$ add check(
data>=$1::timestamp and data<$2::timestamp and maga=$3 )
            $l2$ using rec.d0,rec.d1,rec.maga;
----
which yields to this error messsge:
----
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 )
            "
PL/pgSQL function "f_partition_test" line 25 at istruzione EXECUTE
----
whiile this fragment:
----
            execute $l2$
              insert into $l2$||ct||$l2$
                select * from only public.test
                where data>=$1::timestamp and data<$2::timestamp and maga=$3
            $l2$ using rec.d0,rec.d1,rec.maga;
----
is executed without a glitch in the very same function body.
Where's my error?


-- 
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS

-- 
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