Search Postgresql Archives

Implementing standard SQL's DOMAIN constraint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Happy New Year all,

My readings taught me that standard SQL has a domain constraint that checks
for the same valid characters in a column common to multiple tables.
Example:

CREATE DOMAIN state_code AS char(2)
DEFAULT '??'
CONSTRAINT valid_state_code
CHECK (value IN ('AL', 'AK', 'AZ', ...));

This applies to all tables each having a column named state_code.

I see the value of this feature when multiple tables have start_date and
end_date columns with a constraint that ensures the start_date is <= to the
end date.

Reading the release 10 manual I find many constraints and I want to learn
which one will implement this feature. A pointer is needed.

Rich






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux