Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLAvD-00081z-VJ for pgsql-docs@arkaria.postgresql.org; Mon, 29 Apr 2019 18:22:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hLAvC-0007HO-JX for pgsql-docs@arkaria.postgresql.org; Mon, 29 Apr 2019 18:22:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLAvC-0007DR-94 for pgsql-docs@lists.postgresql.org; Mon, 29 Apr 2019 18:22:34 +0000 Received: from forward103p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:106]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hLAv9-0006Eb-DF for pgsql-docs@lists.postgresql.org; Mon, 29 Apr 2019 18:22:33 +0000 Received: from mxback17o.mail.yandex.net (mxback17o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::68]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 73E4C18C095C for ; Mon, 29 Apr 2019 21:22:29 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback17o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id A29rrV65iY-MTI4qR5t; Mon, 29 Apr 2019 21:22:29 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1556562149; bh=EtwNjJPCcB8uh2qrqTsLYMIvVYvtY00RooSXDgVZwcU=; h=In-Reply-To:Subject:To:From:References:Date:Message-ID; b=KZg6iMElzYAUThXVQaBHd6FCQyPh5XIyGybFvJLIgBUCZGjvyDYJBp8jnleVcOIsw JEjG0u6CETVCSN/VKedbBOOwvlOgdi9GFUw5LsjHswKrQWwy9C2Y8BHBYd8e72LPq6 rp0KozF8qdhg4Yscsq2XGQv6ec9R9BwWkJSN8D+M= Authentication-Results: mxback17o.mail.yandex.net; dkim=pass header.i=@yandex.ru Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id xeeqkS8NYz-MS5iLfkL; Mon, 29 Apr 2019 21:22:28 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) Date: Mon, 29 Apr 2019 21:22:16 +0300 From: Eugen Konkov Message-ID: <1265663903.20190429212216@yandex.ru> To: pgsql-docs@lists.postgresql.org Subject: Re: Why 'infinity' is not in range '[2019-01-02, infinity]'? In-Reply-To: <5f6b986b-de4d-8a43-1366-fc8c3aed6319@postgresql.org> References: <155655432452.1371.6115195379691603427@wrigleys.postgresql.org> <5f6b986b-de4d-8a43-1366-fc8c3aed6319@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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? low= er_inf('(,)'::daterange) true upper_inf(anyrange) boolean is the upper bound infinite? upp= er_inf('(,)'::daterange) true should be spelled: lower_inf(anyrange) boolean is the lower bound unbound? lowe= r_inf('(,)'::daterange) true upper_inf(anyrange) boolean is the upper bound unbound? uppe= r_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 =E2=80=9Cminus i= nfinity=E2=80=9D, or the upper bound is =E2=80=9Cplus infinity=E2=80=9D, re= spectively 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.