Re: Range Types, discrete and/or continuous

From: Robert Haas Jeff Davis Tom Lane , pgsql-hackers(at)postgresql(dot)org Re: Range Types, discrete and/or continuous 2010-10-25 22:03:27 AANLkTika4sfgdt-XSzvOtUDsKhL61AdNPBa5tSt=dt7S@mail.gmail.com (view raw or whole thread) 2010-10-24 21:37:36 from Jeff Davis  2010-10-24 22:59:34 from Tom Lane   2010-10-25 02:40:07 from Robert Haas   2010-10-25 06:53:22 from David Fetter    2010-10-25 14:21:49 from Tom Lane     2010-10-25 15:38:59 from David Fetter   2010-10-25 08:17:10 from Heikki Linnakangas   2010-10-25 16:51:05 from Jeff Davis    2010-10-25 17:00:36 from Robert Haas     2010-10-25 18:27:29 from Jeff Davis      2010-10-25 22:03:27 from Robert Haas       2010-10-26 00:13:10 from Jeff Davis        2010-10-26 01:07:36 from Robert Haas         2010-10-26 13:35:16 from Hitoshi Harada         2010-10-26 17:26:26 from Jeff Davis          2010-10-26 17:35:56 from Robert Haas           2010-10-26 17:42:32 from Tom Lane            2010-10-26 17:52:50 from Robert Haas  2010-10-25 17:20:27 from "Kevin Grittner"   2010-10-25 18:01:56 from Jeff Davis    2010-10-25 18:11:00 from Robert Haas     2010-10-25 18:44:18 from Jeff Davis      2010-10-25 22:28:48 from Robert Haas       2010-10-26 00:01:20 from Jeff Davis        2010-10-26 00:38:20 from Robert Haas  2010-10-31 20:42:34 from Dimitri Fontaine   2010-11-01 19:36:39 from Dimitri Fontaine    2010-11-01 20:39:14 from Jeff Davis pgsql-hackers
```On Mon, Oct 25, 2010 at 2:27 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> On Mon, 2010-10-25 at 13:00 -0400, Robert Haas wrote:
>> I'm still confused.  It seems to me (and maybe I'm full of it) that
>> the distinction between continuous ranges and discrete ranges is
>> pretty minor.  Suppose you have continuous ranges done, and working.
>> The only thing you need to add for discrete ranges (I think) is a
>> canonicalization function that converts a range with one or both ends
>> open to a range with both ends closed.  Then you just apply this
>> canonicalization functions to every value supplied by the user before
>> doing anything else with it.  Poof, discrete ranges!  What am I
>> missing?
>
> That's not too far from what I'm suggesting. On the wiki page, under
> "approach 2" you'll see that one of the functions needed is a
> "constructor" which would put it into a canonical form (if applicable)
> and construct the representation.
>
> I think the difference is that I assumed that the UDFs used for the type
> definition would handle both canonicalization and representation. I
> think what you're suggesting is that postgres could handle
> representation, and just always call the UDF to put it in canonical form
> first. That might make it easier to define new types, but might limit
> any representation optimizations that certain range types may be able to
> exploit. Either approach seems reasonable to me.

Hmm.  Do you have some concrete examples of cases where a range type
might want to do some representational optimization?

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

```

pgsql-hackers by date

 Next: From: Robert Haas Date: 2010-10-25 22:28:48 Subject: Re: Range Types, discrete and/or continuous Previous: From: Robert Haas Date: 2010-10-25 21:01:08 Subject: Re: Floating-point timestamps versus Range Types