Re: range_adjacent and discrete ranges

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: range_adjacent and discrete ranges
Date: 2011-11-18 15:33:13
Message-ID: 16543.1321630393@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Florian Pflug <fgp(at)phlo(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-11-18 15:54:40 Re: WIP: Collecting statistics on CSV file data
Previous Message Simon Riggs 2011-11-18 15:25:12 Re: VACUUM touching file but not updating relation