Re: Checking number of entries
От | Alfred Perlstein |
---|---|
Тема | Re: Checking number of entries |
Дата | |
Msg-id | 20000928165730.Z7553@fw.wintelcom.net обсуждение исходный текст |
Ответ на | Checking number of entries (oberpwd@anubis.network.com (Wade D. Oberpriller)) |
Ответы |
Re: Checking number of entries
|
Список | pgsql-general |
* 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."
В списке pgsql-general по дате отправления: