Tom Lane <t...@sss.pgh.pa.us> wrote:
 
> A domain constraint is a constraint that is specified for a
> domain.
>   It is applied to all columns that are based on that domain, and
>   to all values cast to that domain.
> 
> If you take that literally, it means that domain constraints are
> applied
> (1) in an assignment to a table column of a domain type, and
> (2) in an explicit CAST to the domain type, and
> (3) nowhere else.
 
I'm curious how you jumped from "all values cast" to "explicit CAST"
and "nowhere else".  The standard does describe implicit casts.
 
That said, section 4.7.5 talks about supertypes and subtypes, so if
I ever want such behavior, it seems to match pretty well (on a quick
scan) to what the standard outlines there.  No need to invent
different mechanisms.
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to