pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: jani.rahkola@iki.fi
To: pgsql-docs@lists.postgresql.org
Subject: Re: Documentation of return values of range functions lower and upper
Date: Thu, 12 Nov 2020 09:14:12 +0100
Message-ID: <16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at> (raw)
In-Reply-To: <53ec9f116bea9252d7fa9341e024530553656c42.camel@cybertec.at>
References: <160508672127.25505.8356390205508789564@wrigleys.postgresql.org>
	<53ec9f116bea9252d7fa9341e024530553656c42.camel@cybertec.at>

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

Attachments:

  [text/x-patch] 0001-Improve-upper-lower-documentation-for-ranges.patch (1.4K, ../16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at/2-0001-Improve-upper-lower-documentation-for-ranges.patch)
  download | inline diff:
From b17d2d968268257c5d1385bb834747fe3c33834b Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@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.8356390205508789564@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



view thread (14+ messages)  latest in thread

Message-ID: <16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at>
Permalink:  ../16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at/
Also on:    postgresql.org/message-id/16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at

 ·  · 

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: pgsql-docs@postgresql.org
  Cc: laurenz.albe@cybertec.at, jani.rahkola@iki.fi, pgsql-docs@lists.postgresql.org
  Subject: Re: Documentation of return values of range functions lower and upper
  In-Reply-To: <16601466752e40543051369fac722c0a200bb4e6.camel@cybertec.at>

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

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