Re: Enum in PostgreSQL - How to - Mailing list pgsql-general

From Dan Langille
Subject Re: Enum in PostgreSQL - How to
Date
Msg-id 3E9140CC.28493.A1E2EFB@localhost
Whole thread Raw
In response to Re: Enum in PostgreSQL - How to  ("Dan Langille" <dan@langille.org>)
List 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 by date:

Previous
From: "Dan Langille"
Date:
Subject: Re: possible time change issue - known problem?
Next
From: Manfred Koizar
Date:
Subject: Re: unable to dump database, toast errors