Re: Enum in PostgreSQL - How to
От | Dan Langille |
---|---|
Тема | Re: Enum in PostgreSQL - How to |
Дата | |
Msg-id | 3E9140CC.28493.A1E2EFB@localhost обсуждение исходный текст |
Ответ на | Re: Enum in PostgreSQL - How to ("Dan Langille" <dan@langille.org>) |
Список | pgsql-general |
On 7 Apr 2003 at 15:04, Jürgen Hauser wrote: > Hi, > > thanks for your reply. However, the mentioned method doesm't seem to work. > > I also tried something like > > CREATE TABLE accounts > ( > accountid SERIAL, > PRIMARY KEY (accountid), > .... > accountType CHECK ( accountType = 'default' OR accountType = 'custom') > NOT NULL); > > But this doesn't work either.... Please CC all posts to the mailing list. Explaining what "doesn't work" helps, but I think I see the problem. The example shown in the URL provided is incomplete. But looking up that CHECK option will show the correct syntax. Please see http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=sql- createtable.html and look in the Examples section: name VARCHAR(40) NOT NULL CHECK (name <> '') You need a variable time, in your case, I suggest TEXT. -- Dan Langille : http://www.langille.org/
В списке pgsql-general по дате отправления: