Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?

Поиск
Список
Период
Сортировка
От Eugen Konkov
Тема Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?
Дата
Msg-id 1265663903.20190429212216@yandex.ru
обсуждение исходный текст
Ответ на Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Ответы Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-docs
1.
Also I found next ambiguous part:

    select upper_inf(  '["2018-08-14","Infinity")'::daterange );


Thanks  jstag  from  IRC for explanation that unbound and infinite are
different essence.

Thus, on the page
https://www.postgresql.org/docs/11/functions-range.html

lower_inf(anyrange)     boolean         is the lower bound infinite?    lower_inf('(,)'::daterange)     true
upper_inf(anyrange)     boolean         is the upper bound infinite?    upper_inf('(,)'::daterange)     true


should be spelled:

lower_inf(anyrange)     boolean         is the lower bound unbound?    lower_inf('(,)'::daterange)     true
upper_inf(anyrange)     boolean         is the upper bound unbound?    upper_inf('(,)'::daterange)     true

should not?


2.
I  do  not  know, it where are any sense to distinguish:
[ 2019-01-01, infinity ) and [ 2019-01-01, )

and because: https://www.postgresql.org/docs/11/rangetypes.html#RANGETYPES-INFINITE

 This is equivalent to considering that the lower bound is “minus infinity”, or the upper bound is “plus infinity”,
respectively

and because of next statement does not work:

 select '[2019-01-02,"infinity"]'::daterange @> 'infinity'::date;


if   you  allow I will suggest to map/convert 'infinity' value to
unbound range, for datatypes which defines 'infinity' value.
so these two become same:

    [ 2019-01-01, infinity ) and [ 2019-01-01, )

It seems more consistent in compare to current behavior.




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

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?