Re: Singleton range constructors versus functional coercion notation

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Singleton range constructors versus functional coercion notation
Date: 2011-11-21 03:24:16
Message-ID: 1321845856.11794.65.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2011-11-21 03:55:49 Re: WIP: Collecting statistics on CSV file data
Previous Message Peter Geoghegan 2011-11-21 02:02:06 Re: Inlining comparators as a performance optimisation