Re: Weird EXECUTE ... USING behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Weird EXECUTE ... USING behaviour
Date: 2010-01-12 14:13:44
Message-ID: 2957.1263305624@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it> writes:
> 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

You can't use a parameter of the function in a CHECK constraint on a
table. The CHECK constraint is permanent and can't refer to transient
state like that.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2010-01-12 14:24:13 Re: Weird EXECUTE ... USING behaviour
Previous Message Vincenzo Romano 2010-01-12 14:09:04 Weird EXECUTE ... USING behaviour