Re: Range Types: empty ranges

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Josh Berkus" <josh(at)agliodbs(dot)com>, "Jeff Davis" <pgsql(at)j-davis(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range Types: empty ranges
Date: 2011-02-11 19:08:32
Message-ID: 4D5534D0020000250003A87E@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-02-11 19:09:09 Re: Debian readline/libedit breakage
Previous Message Jeff Davis 2011-02-11 19:06:52 Re: Range Types: empty ranges