Re: Domains versus polymorphic functions, redux
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: "David E. Wheeler" <david@kineticode.com>, Noah Misch <noah@leadboat.com>, pgsql-hackers@postgresql.org, lr@pcorp.us
Date: 2011-06-03T18:27:19Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > The real crux of the issue here is: under what circumstances should we > look through the domain wrapper around an underlying type, and under > what circumstances should we refrain from doing so? That's half of it. The other half is: when we *do* look through the wrapper, is that equivalent to having implicitly inserted a downcast to the base type, so that the results are now indistinguishable from having given a base-type value to begin with? Or is the expression's behavior still affected by the fact of having given a domain value, and if so, how exactly? I assert that matching a domain-over-array to an ANYARRAY parameter certainly involves having "looked through the wrapper". It's considerably fuzzier though what should happen when matching a domain to ANYELEMENT. regards, tom lane