Re: Range Types: empty ranges - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Range Types: empty ranges
Date
Msg-id 4D5534D0020000250003A87E@gw.wicourts.gov
Whole thread Raw
In response to Re: Range Types: empty ranges  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Range Types: empty ranges  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:
>> I think that range '[15:15:00,15:15:00)' should be valid as a
>> zero-length range between, for example, '[15:00:00,15:15:00)' and
>> '[15:15:00,15:30:00)'.
> 
> How would that actually work?  I kind of agree with Josh: I'd be
> inclined to make the type input function boot such constructs at
> the door.
It makes more sense in the context of a range of some type with a
clearly defined granularity.  Our accounting system, for example,
can assign a new range of receipt IDs for each calendar year.  If
you want a variable to represent the receipts for traffic receipts
for 2012, you might, in preparation for the upcoming year, define
something to declare the range as '[12TR000001,12TR000001)'.  When
the first receipt is assigned as 12TR000001, that is updated to
'[12TR000001,12TR000002)'.  Just as an off-the-cuff example.
Basically, with a type having well-defined granularity, a [) range
could usefully represent, "start to last used", and start out empty.
-Kevin


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Range Types: empty ranges
Next
From: Greg Smith
Date:
Subject: Re: Debian readline/libedit breakage