pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dino Maric <dinom@hey.com>
To: pgsql-bugs@lists.postgresql.org
Subject: Confusion about the range types
Date: Sat, 07 Jan 2023 16:17:19 +0100
Message-ID: <d1bbdc3da826051cc37efc1094673a2357ace614@hey.com> (raw)

Hey!

This is first time I'm writing, so I hope I've done this correctly :)

I'm confused about how range types are returned when queried

When I insert range like this:

INSERT INTO public.tests
VALUES (int4range(7,8,'[]'))

or this

INSERT INTO public.tests
VALUES ('[7,8]')

----------------

After when querying table my return value for this column is not [7,8]
but it is [7,9).
I found this behaviour confusing, because I want to insert 7-8 ranges
(including upper value) and then present that range to a user.

Maybe I'm missing something :)



My PG version is: PostgreSQL 14.0 on aarch64-apple-darwin20.6.0,
compiled by Apple clang version 12.0.5 (clang-1205.0.22.9), 64-bit





--
Sent with HEY <https://hey.com/sent; — Email as it should be

view thread (3+ messages)  latest in thread

Message-ID: <d1bbdc3da826051cc37efc1094673a2357ace614@hey.com>
Permalink:  ../d1bbdc3da826051cc37efc1094673a2357ace614@hey.com/
Also on:    postgresql.org/message-id/d1bbdc3da826051cc37efc1094673a2357ace614@hey.com

 · 

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-bugs@postgresql.org
  Cc: dinom@hey.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Confusion about the range types
  In-Reply-To: <d1bbdc3da826051cc37efc1094673a2357ace614@hey.com>

* 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