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

From Tom Lane
Subject Re: range_adjacent and discrete ranges
Date
Msg-id 16543.1321630393@sss.pgh.pa.us
Whole thread Raw
In response to Re: range_adjacent and discrete ranges  (Florian Pflug <fgp@phlo.org>)
Responses Re: range_adjacent and discrete ranges
List pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> ...This definition does not depend on any specific canonical form of ranges,
> only on the canonicalize function's ability to detect empty ranges.

Hmm, well, now that you mention it, I don't think the current canonical
functions handle empty ranges very nicely at all.  They tend to spit up:

regression=# select int4range(4,4,'[]');int4range 
-----------[4,5)
(1 row)

regression=# select int4range(4,4,'(]');
ERROR:  range lower bound must be less than or equal to range upper bound
regression=# select int4range(4,4,'()');
ERROR:  range lower bound must be less than or equal to range upper bound

Would it be better for them to silently transform such cases to "empty"?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [GENERAL] VACUUM touching file but not updating relation
Next
From: Robert Haas
Date:
Subject: Re: WIP: Collecting statistics on CSV file data