Weird EXECUTE ... USING behaviour

Поиск
Список
Период
Сортировка
От Vincenzo Romano
Тема Weird EXECUTE ... USING behaviour
Дата
Msg-id 3eff28921001120609v24ead653m30e72d2120d612b6@mail.gmail.com
обсуждение исходный текст
Ответы Re: Weird EXECUTE ... USING behaviour  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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

В списке pgsql-general по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: need help with query, how to fold select result to array?
Следующее
От: Sergey Levchenko
Дата:
Сообщение: Re: need help with query, how to fold select result to array?