* Wade D. Oberpriller <oberpwd@anubis.network.com> [000928 15:34] wrote:
> Hello,
>
> Is it possible to restrict the number of entries in a table? I have attempted
> to write a check like so:
>
> CREATE TABLE mytable (
> id integer NOT NULL,
> CHECK (COUNT(id) <= 10)
> );
>
> This is not allowed, I get an error saying:
>
> ERROR: ExecEvalAggref: no aggregates in this expression context
>
> What is the proper way of doing this? I want to be able to force a minimum and
> maximum number of entries.
Use a trigger on INSERT that does that.
--
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."