public inbox for [email protected]  
help / color / mirror / Atom feed
From: Eugen Konkov <[email protected]>
To: [email protected]
Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?
Date: Mon, 29 Apr 2019 21:22:16 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[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.






view thread (9+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox