On Wed, 2020-11-11 at 18:19 +0100, Laurenz Albe wrote:
> > Table 9.54 in page
> > https://www.postgresql.org/docs/current/functions-range.html states that the
> > functions lower and upper return NULL if the requested bound is infinite. If
> > the element type of the range contains the special values infinity and
> > -infinity, this is not correct, as those values are returned if explicitly
> > used as either bound.
> 
> +1
> 
> Perhaps it would be better to say
> 
>   NULL if the range is empty or has no lower/upper bound

Here is a patch for this.

Yours,
Laurenz Albe
From b17d2d968268257c5d1385bb834747fe3c33834b Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.a...@cybertec.at>
Date: Thu, 12 Nov 2020 09:13:09 +0100
Subject: [PATCH] Improve upper/lower documentation for ranges

The old wording could give the impression that these
functions would return NULL if the range is bounded
by a value "infinity".  Report by Jani Rahkola.

Discussion: https://postgr.es/m/160508672127.25505.8356390205508789...@wrigleys.postgresql.org
---
 doc/src/sgml/func.sgml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 2783985b55..d290653ae8 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -18176,7 +18176,7 @@ SELECT NULLIF(value, '(none)') ...
        </para>
        <para>
         Extracts the lower bound of the range (<literal>NULL</literal> if the
-        range is empty or the lower bound is infinite).
+        range is empty or has no lower bound).
        </para>
        <para>
         <literal>lower(numrange(1.1,2.2))</literal>
@@ -18194,7 +18194,7 @@ SELECT NULLIF(value, '(none)') ...
        </para>
        <para>
         Extracts the upper bound of the range (<literal>NULL</literal> if the
-        range is empty or the upper bound is infinite).
+        range is empty or has no upper bound).
        </para>
        <para>
         <literal>upper(numrange(1.1,2.2))</literal>
-- 
2.26.2

Reply via email to