Re: Domains versus polymorphic functions, redux

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, lr(at)pcorp(dot)us
Subject: Re: Domains versus polymorphic functions, redux
Date: 2011-06-03 18:07:44
Message-ID: BANLkTinCH7V1=ATPhGm6TUCD=FjSVFWvZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 3, 2011 at 1:00 PM, David E. Wheeler <david(at)kineticode(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-06-03 18:10:03 Re: reducing the overhead of frequent table locks - now, with WIP patch
Previous Message Kevin Grittner 2011-06-03 18:04:19 Re: SIREAD lock versus ACCESS EXCLUSIVE lock