Re: [PATCH] Support empty ranges with bounds information

From: Isaac Morland <isaac(dot)morland(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Jeff Davis <pgsql(at)j-davis(dot)com>
Subject: Re: [PATCH] Support empty ranges with bounds information
Date: 2021-03-04 15:21:46
Message-ID: CAMsGm5dR2YzXCpcEShOrnsyQJ0Q+Y298E6hRcquRYHaew=hZyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 4 Mar 2021 at 01:25, Joel Jacobson <joel(at)compiler(dot)org> wrote:

Suggestion #1: Use [] as the canonical form for discrete types.
> This would allow creating ranges for all values for discrete types.
>

I won't reiterate here, but there are fundamental reasons why [) is
definitely the right default and canonical form.

In any case, you can create a range containing the last value:

odyssey=> select 2147483647 <@ int4range (0, null);
?column?
----------
t
(1 row)

odyssey=>

It does seem reasonable to me to change it so that specifying the last
value as the right end with ] would use a null endpoint instead of
producing an error when it tries to increment the bound.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-03-04 15:29:12 Re: pg_amcheck contrib application
Previous Message Tom Lane 2021-03-04 15:21:41 Re: make coverage-html would fail within build directory separate from source tree