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

Eugen Konkov <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.documentation
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.