Re: Singleton range constructors versus functional coercion notation - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Singleton range constructors versus functional coercion notation
Date
Msg-id 1321845856.11794.65.camel@jdavis
Whole thread Raw
In response to Re: Singleton range constructors versus functional coercion notation  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Singleton range constructors versus functional coercion notation
List pgsql-hackers
On Sat, 2011-11-19 at 15:57 -0500, Tom Lane wrote:
> > I'm hesitant to remove them because the alternative is significantly
> > more verbose:
> >   numrange(1.0, 1.0, '[]');
> 
> Right.  The question is, does the case occur in practice often enough
> to justify a shorter notation?  I'm not sure.

Well, if there were a good shorter notation, then probably so. But it
doesn't look like we have a good idea, so I'm fine with dropping it.

> One thing I've been thinking for a bit is that for discrete ranges,
> I find the '[)' canonical form to be surprising/confusing.  If we
> were to fix range_adjacent along the lines suggested by Florian,
> would it be practical to go over to '[]' as the canonical form?
> One good thing about that approach is that canonicalization wouldn't
> have to involve generating values that might overflow.

I think we had that discussion before, and Florian brought up some good
points (both then and in a reply now). Also, Robert wasn't convinced
that '[]' is necessarily better for discrete ranges:

http://archives.postgresql.org/pgsql-hackers/2011-10/msg00598.php

Regards,Jeff Davis




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Inlining comparators as a performance optimisation
Next
From: Etsuro Fujita
Date:
Subject: Re: WIP: Collecting statistics on CSV file data