Re: Range Types - typo + NULL string constructor - Mailing list pgsql-hackers

From Florian Pflug
Subject Re: Range Types - typo + NULL string constructor
Date
Msg-id 01755379-7AFC-4B2F-ABF2-5F5F8414A80D@phlo.org
Whole thread Raw
In response to Re: Range Types - typo + NULL string constructor  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Range Types - typo + NULL string constructor  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Oct10, 2011, at 18:53 , Tom Lane wrote:
> What if I write '[1,INT_MAX]'::int4range?  The open-parenthesis form will
> fail with an integer overflow.  I suppose you could canonicalize it to
> an unbounded range, but that seems unnecessarily surprising.

That is a very good point. Canonicalizing to an unbounded range doesn't work,
because, as it stands, the ranges '[1, INT_MAX]' and '[1,)' are *not* equal. So
the only remaining option is to canonicalize to the closed form always.

I still think we should strive for consistency here, so let's also make
'[]' the default flags for the range constructors.

best regards,
Florian Pflug



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: SET variable - Permission issues
Next
From: Bruce Momjian
Date:
Subject: COUNT(*) and index-only scans