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

From Robert Haas
Subject Re: Domains versus polymorphic functions, redux
Date
Msg-id BANLkTinCH7V1=ATPhGm6TUCD=FjSVFWvZQ@mail.gmail.com
Whole thread Raw
In response to Re: Domains versus polymorphic functions, redux  ("David E. Wheeler" <david@kineticode.com>)
Responses Re: Domains versus polymorphic functions, redux
Re: Domains versus polymorphic functions, redux
List pgsql-hackers
On Fri, Jun 3, 2011 at 1:00 PM, David E. Wheeler <david@kineticode.com> wrote:
> On Jun 3, 2011, at 8:22 AM, Robert Haas wrote:
>
>> Well, as Bill Clinton once said, "it depends on what the meaning of
>> the word 'is' is".  I think of array types in PostgreSQL as meaning
>> "the types whose monikers end in a pair of square brackets".
>
> Man, range types are going to fuck with your brainz.

They may, but probably not for this reason.  Domain types have this
weird property that we want all of the base type operations to still
work on them, except when we don't want that.  Range types won't have
that property, or at least I don't think so.  Someone might expect
1::foo + 2::foo to work when foo is a domain over int, but they
probably won't expect '[1,2]'::intrange + '[2,3)'::intrange to work.
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?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Next
From: Noah Misch
Date:
Subject: Re: reducing the overhead of frequent table locks - now, with WIP patch