Re: Range Types: empty ranges

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Range Types: empty ranges
Дата
Msg-id 4D5554E4020000250003A8D3@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Jeff Davis <pgsql@j-davis.com> wrote:
>> Perhaps it was a mistake to get so concrete rather than
>> conceptual -- basically, it seems like it could be a useful
>> concept for any planned or scheduled range with an indeterminate
>> end point, which you want to "reserve" up front and record in
>> progress until complete.
> 
> Maybe this is a range... would it be served by:
>   (5, INF)
> or:
>   [5, INF)
> ?
> 
> That's already supported, and it means "all points greater than
> 5".
Well that would create a range of infinite size until you started
using it, at which point it would drop to tiny and start to increase
until completion, which would be kinda weird as well as error-prone.
At least for the uses I'm considering.  I'm sure we can work around
it if it isn't supported, but for our purposes, [x,x) ranges would
be a useful construct.
>> Of course, the *most* useful places for our shop to have ranges
>> are temporal.  Many (most?) of those are situations where you
>> start with a range with an unknown end and later (often years
>> later) fill in the end of the range based on some event which
>> finally closes it.  Again, two discreet dates with a null-capable
>> end-date work, but I can see where ranges could potentially be
>> more powerful.
> 
> Ranges support infinite boundaries, but do not support NULL
> (previous discussion concluded that NULL boundaries were likely to
> be confusing and served no obvious use case not handled by
> infinity).
Yeah, infinity works fine as long as you realize it's only
temporary.  I don't know whether there are any practical uses where
on the low end it doesn't mean "some particular date we don't know
or don't care enough to determine" and on the high end doesn't mean
"some particular date which we don't know or which hasn't yet been
fixed".  For the latter we have, so far, been using NULL, since we
were trying to stay portable and not all products support infinity.
We're committing to PostgreSQL now, so we could start to use
infinity for these temporarily indefinite values, and I would expect
to do so in ranges.
-Kevin


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Daniel Farina
Дата:
Сообщение: Re: Debian readline/libedit breakage
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Replication server timeout patch