Re: Domains versus polymorphic functions, redux - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Domains versus polymorphic functions, redux
Date
Msg-id 4DE8F66F020000250003E11E@gw.wicourts.gov
Whole thread Raw
In response to Re: Domains versus polymorphic functions, redux  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@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


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Nested CASE-WHEN scoping
Next
From: Andrew Chernow
Date:
Subject: Re: Error in PQsetvalue