Re: CHECK() Constraint on Column Using Lookup Table - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: CHECK() Constraint on Column Using Lookup Table
Date
Msg-id 46377EB7.1050503@commandprompt.com
Whole thread Raw
In response to CHECK() Constraint on Column Using Lookup Table  (Rich Shepard <rshepard@appl-ecosys.com>)
Responses Re: CHECK() Constraint on Column Using Lookup Table
List pgsql-general
Rich Shepard wrote:
>   I've seen the syntax for using a lookup table in a CHECK() constraint,
> but
> I cannot find a reference to it. It's not in Section 5.3.1 of the 8.2 docs.
>
>   Specifically, I want to reference a table of ISO 2-letter codes for US
> states and Canadian provinces/territories in a table with name and address
> columns.
>
>   Please point me to a reference.

You could use a function, or a foreign key.


Joshua D. Drake

>
> Rich
>


--

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


pgsql-general by date:

Previous
From: Brad Nicholson
Date:
Subject: Dynamically Allocated System Resources
Next
From: Richard Broersma Jr
Date:
Subject: Re: CHECK() Constraint on Column Using Lookup Table