--- Rich Shepard <[EMAIL PROTECTED]> 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.

Using sub-queries in a table DDL is legal per SQL92, but Postgresql doesn't 
support this syntax. 
However, I don't see what you would need it since the "REFERENCES" predicate 
should work just fine
for you.

You can scroll down to the passages that discuss the check constraint from the 
following page:
http://www.postgresql.org/docs/8.2/interactive/sql-createtable.html

Regards,
Richard Broersma Jr.

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to