Re: Problem with subquery in CHECK constraint.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Niall Smart <niall(dot)smart(at)ebeon(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Problem with subquery in CHECK constraint.
Date: 2000-06-07 15:48:38
Message-ID: 3912.960392918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Niall Smart <niall(dot)smart(at)ebeon(dot)com> writes:
> However when trying to insert into CUST I get the following error:
> ERROR: ExecEvalExpr: unknown expression type 108
> Is this a bug in PostGreSQL?

Yup. Looks like the subquery is not getting expanded into a subplan.
Could be a little messy to fix, unless we redo the planning on every
execution of the check constraint ... which doesn't sound appetizing.

For now I'd suggest putting the subquery into an SQL or plpgsql function
that you invoke from the constraint expression.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ed Loehr 2000-06-07 16:49:55 Re: how to know when a table is altered
Previous Message Ed Loehr 2000-06-07 15:37:14 Re: [SQL] oracle rownum equivalent?