Re: Domains versus polymorphic functions, redux

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, "Noah Misch" <noah(at)leadboat(dot)com>,<lr(at)pcorp(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Domains versus polymorphic functions, redux
Date: 2011-06-03 19:57:51
Message-ID: 4DE8F66F020000250003E11E@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2011-06-03 20:06:47 Re: Error in PQsetvalue
Previous Message Heikki Linnakangas 2011-06-03 19:46:16 Re: Nested CASE-WHEN scoping