Re: CONSTRAINT name With Domain As Check - Mailing list pgsql-general

From Tom Lane
Subject Re: CONSTRAINT name With Domain As Check
Date
Msg-id 18198.1177822317@sss.pgh.pa.us
Whole thread Raw
In response to CONSTRAINT name With Domain As Check  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: CONSTRAINT name With Domain As Check  (Rich Shepard <rshepard@appl-ecosys.com>)
List pgsql-general
Rich Shepard <rshepard@appl-ecosys.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

pgsql-general by date:

Previous
From: "Alexander Staubo"
Date:
Subject: Re: DRI in Docs?
Next
From: Tom Lane
Date:
Subject: Re: Temporal Units