Re: CONSTRAINT name With Domain As Check

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CONSTRAINT name With Domain As Check
Date: 2007-04-29 04:51:57
Message-ID: 18198.1177822317@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Shepard <rshepard(at)appl-ecosys(dot)com> writes:
> I define a table, Permits, that includes a column for type.
> Permit_Type is a domain with permissible names:

> CREATE DOMAIN Permit_Type
> as TEXT
> CHECK (value in ('Environmental', 'Health', 'Safety', 'Occupancy'));

> Can I name that domain check within the Permits table as follows?

> CREATE TABLE Permits (
> ...
> type Permit_Type
> CONSTRAINT invalid_permit_type
> ...
> );

Um, what are you trying to do that's different from declaring a column
of the table as being of type Permit_Type?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-04-29 04:58:26 Re: Temporal Units
Previous Message Alexander Staubo 2007-04-29 04:02:37 Re: DRI in Docs?