Re: CHECK() Constraint on Column Using Lookup Table

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: CHECK() Constraint on Column Using Lookup Table
Date: 2007-05-01 17:53:59
Message-ID: 46377EB7.1050503@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma Jr 2007-05-01 17:55:34 Re: CHECK() Constraint on Column Using Lookup Table
Previous Message Rich Shepard 2007-05-01 17:41:44 CHECK() Constraint on Column Using Lookup Table