Re: range_adjacent and discrete ranges - Mailing list pgsql-hackers

From Tom Lane
Subject Re: range_adjacent and discrete ranges
Date
Msg-id 23299.1321645666@sss.pgh.pa.us
Whole thread Raw
In response to Re: range_adjacent and discrete ranges  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: range_adjacent and discrete ranges
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> On Fri, 2011-11-18 at 10:33 -0500, Tom Lane wrote:
>> Would it be better for them to silently transform such cases to "empty"?

> I wouldn't like to extend that to int4range(4,3), however. When the
> upper bound is less than the lower bound, it's almost certainly a
> mistake, and the user should be informed.

Yeah, probably not.  However, I don't like the idea of
'(3,4)'::int4range throwing an error, as it currently does, because it
seems to require the application to have quite a lot of knowledge of the
range semantics to avoid having errors sprung on it.

> By the way, what does this have to do with canonical functions? This
> seems more like a constructor issue, and there is already a
> zero-argument constructor to make empty ranges.

What I was concerned about was whether Florian's idea of implementing
range_adjacent by testing for empty intervening range would work, or
would fail because of errors getting thrown.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: testing ProcArrayLock patches
Next
From: "Kevin Grittner"
Date:
Subject: Re: testing ProcArrayLock patches