Philip Warner <pjw@rhyme.com.au> writes:
> Under 7.1 (and with the constraint in the table definition in 7.0.2) and it
> lets me define the table & constraint, but when I insert into the table, I
> get:
> ERROR: ExecEvalExpr: unknown expression type 108
> Seems to me it should either disallow the creation, or work properly.
Picky, picky ...
I've added the appropriate checks to AddRelationRawConstraints():
regression=# Alter TABLE mytable Add
regression-# CHECK ( (Select COUNT(distinct id) From mytable) <= 10);
ERROR: Cannot use subselect in CHECK clause
regression=# Alter TABLE mytable Add
regression-# CHECK ( COUNT( id) <= 10);
ERROR: Cannot use aggregate in CHECK clause
Coming soon to a CVS server near you.
regards, tom lane