Re: Checking number of entries

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Alfred Perlstein <bright(at)wintelcom(dot)net>, "Wade D(dot) Oberpriller" <oberpwd(at)anubis(dot)network(dot)com>, general-help postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Checking number of entries
Date: 2000-09-29 04:04:10
Message-ID: 15811.970200250@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philip Warner <pjw(at)rhyme(dot)com(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-09-29 04:22:26 Re: Checking number of entries
Previous Message Philip Warner 2000-09-29 03:34:25 Re: Checking number of entries