Checking number of entries

From: oberpwd(at)anubis(dot)network(dot)com (Wade D(dot) Oberpriller)
To: pgsql-general(at)postgresql(dot)org (general-help postgresql)
Subject: Checking number of entries
Date: 2000-09-28 22:28:39
Message-ID: 200009282228.RAA00652@truck.network.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Wade Oberpriller
StorageTek
oberpwd(at)network(dot)com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alfred Perlstein 2000-09-28 23:57:30 Re: Checking number of entries
Previous Message Mikheev, Vadim 2000-09-28 22:09:28 RE: pg-log File