pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: themyth.cs@gmail.com
Subject: INT4RANGE Upper bound always includes a higher number
Date: Tue, 03 Oct 2023 19:00:49 +0000
Message-ID: <169635964997.3727336.14464470245213767871@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/16/rangetypes.html
Description:

Hi,
First I just wanted to say, the documentation is overall excellent, it has
been such a pleasure learning postgres.
In the RANGE types where it says the square bracket indicates upper bound
inclusive ],
But the issue with this is when I do upper bound inclusive it always goes
one number above. 
This is contrary to your documentation says and it is also counter
intuitive.
According to your example (copied from your docs):

-- includes 3, does not include 7, and does include all points in between
SELECT '[3,7)'::int4range;

But this is not true, it shows 3 and 7

And if i do:
SELECT '(3,7]'::INT4RANGE;
It shows:

 [4,8)
(1 row)

Please can someone explain ?

Thank you


view thread (2+ messages)  latest in thread

Message-ID: <169635964997.3727336.14464470245213767871@wrigleys.postgresql.org>
Permalink:  ../169635964997.3727336.14464470245213767871@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/169635964997.3727336.14464470245213767871@wrigleys.postgresql.org

 · 

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: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, themyth.cs@gmail.com
  Subject: Re: INT4RANGE Upper bound always includes a higher number
  In-Reply-To: <169635964997.3727336.14464470245213767871@wrigleys.postgresql.org>

* 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