Confusion about the range types

From: Dino Maric <dinom(at)hey(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Confusion about the range types
Date: 2023-01-07 15:17:19
Message-ID: d1bbdc3da826051cc37efc1094673a2357ace614@hey.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-01-07 16:13:06 Re: Confusion about the range types
Previous Message Magnus Hagander 2023-01-07 13:56:44 Re: BUG #17738: There is a typo on your website