Re: extended operator classes vs. type interfaces

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Nathan Boley <npboley(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: extended operator classes vs. type interfaces
Date: 2010-04-09 23:55:34
Message-ID: q2m603c8f071004091655p5c368881mdb1ef01f8c6256ef@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 9, 2010 at 7:53 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Apr 9, 2010 at 7:18 PM, Nathan Boley <npboley(at)gmail(dot)com> wrote:
>>> The advantage of specifying a + and a - in the type interface is that
>>> the unit definition can then be specified as part of the type
>>> declaration itself.  So you can do:
>>>
>>> CREATE TYPE ts_sec AS RANGE OVER timestamp (UNIT = '1s');
>>> CREATE TYPE ts_min AS RANGE OVER timestamp (UNIT = '1m');
>>>
>>> All of the stuff about defining + and - is hidden from the user - it's
>>> part of the type interface, which is pre-created.
>>
>> The disadvantage is that it does not permit irregularly spaced units.
>
> True.  The only types I can think of that have irregularly spaced
> units would be things based on floating points, and I was assuming
> that people would only want continuous intervals on those.  If someone
> really wants to be able to deduce that [1.0,3.0) = [1.0,3.0-epsilon),
> then we need a different design.  But I find it hard to believe that's
> very useful.  Maybe you feel otherwise?

Er, that [1.0,3.0) = [1.0,3.0-epsilon], rather.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Adams 2010-04-10 00:18:01 Re: Gsoc XQuery
Previous Message Robert Haas 2010-04-09 23:53:51 Re: extended operator classes vs. type interfaces