Re: WIP: Range Types - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WIP: Range Types
Date
Msg-id AANLkTikW+E=Etk+izaXqBSLa4zMh1wSZcj5i1d_c91Sn@mail.gmail.com
Whole thread Raw
In response to WIP: Range Types  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: WIP: Range Types  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Tue, Jan 4, 2011 at 2:29 AM, Jeff Davis <pgsql@j-davis.com> wrote:
> I liked Robert's suggestion here:
>
> http://archives.postgresql.org/message-id/AANLkTiks_x93_k82b4f_ga634wCi0oeb9fTrUrF28EGM@mail.gmail.com
>
> which says that the user can just define a "canonicalize" function that
> will take a range as input (or perhaps the logical pieces of a range)
> and put it into an appropriate canonical representation. For instance,
> int4range_canonical might take (1,4] and turn it into [2,4]. This is
> similar to a few other ideas, but Robert's idea seems to require the
> least effort by the person defining the range type, because postgresql
> can still handle representation.
>
> It doesn't allow for all of the suggested features. In particular, it
> would not allow "granules" to be specified for discrete ranges. But on
> balance, it seems like this is the most conceptually simple and I think
> it satisfies the primary use cases.

Maybe I'm missing something, but it seems like this approach could
support granules.  You just have to define the canonicalize function
in terms of the granule.

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


pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Re: new patch of MERGE (merge_204) & a question about duplicated ctid
Next
From: "David E. Wheeler"
Date:
Subject: Re: Upgrading Extension, version numbers