Checking number of entries

Поиск
Список
Период
Сортировка
От oberpwd@anubis.network.com (Wade D. Oberpriller)
Тема Checking number of entries
Дата
Msg-id 200009282228.RAA00652@truck.network.com
обсуждение исходный текст
Ответы Re: Checking number of entries  (Alfred Perlstein <bright@wintelcom.net>)
Список 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@network.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "Mikheev, Vadim"
Дата:
Сообщение: RE: pg-log File
Следующее
От: Alfred Perlstein
Дата:
Сообщение: Re: Checking number of entries