Re: Domains versus polymorphic functions, redux

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Cc: "Robert Haas" <robertmhaas@gmail.com>, "David E. Wheeler" <david@kineticode.com>, "Noah Misch" <noah@leadboat.com>, lr@pcorp.us, pgsql-hackers@postgresql.org
Date: 2011-06-03T19:01:24Z
Lists: pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Another long-range nicety would be something which I have seen in
> some other databases, and which is consistent with the inheritance
> theme, is that you can't compare or assign dissimilar domains -- an
> error is thrown. So if you try to join from the eye color column in
> a person table to the key of a hair color table, you get an error
> unless you explicitly cast one or both of them to the common type.

[ raised eyebrow ... ]  This is all pretty cute, but I think it goes
against both the letter and spirit of the SQL standard.  What you
are describing might be a useful thing to have, but it isn't a SQL
domain.

			regards, tom lane