Re: Range Types, discrete and/or continuous

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>,<pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range Types, discrete and/or continuous
Date: 2010-10-25 17:20:27
Message-ID: 4CC5760B0200002500036DBB@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> Last development cycle, one of the questions that was unresolved
> was whether to handle ranges like a discrete set (that is, [1,5) =
> [1,4] ) or continuous or both.
>
> I think that discrete ranges are required. For instance, day range
> and IP address ranges are two examples where treating them
> continuously would clearly cause confusion. "Monday until
> Thursday" is the same as "Monday through Wednesday," and it would
> be dangerous to treat them as different values.

All of the use cases I've been able to imagine as useful for our
shop would work fine with discrete ranges. Continuous ranges seem
as though they would be more clumsy and dangerous for these use
cases. Having not seen or imagined a practical use case for
continuous ranges, I'm indifferent to support for them.

It would be very useful to be able to specify a granularity -- for
example timestamps with a five minute granularity would be useful
for scheduling appointments. In some cases the granularity might be
inferred -- if we have a domain defined as numeric(13,2), it would
be nice if the default granularity was 0.01::numeric.

-Kevin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-10-25 17:28:36 Re: Segfault in 9.0 inlining SRF
Previous Message Brendan Jurd 2010-10-25 17:20:26 Re: Segfault in 9.0 inlining SRF