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

From Jeff Davis
Subject Re: Range Types - typo + NULL string constructor
Date
Msg-id 1316624439.7281.214.camel@jdavis
Whole thread Raw
In response to Re: Range Types - typo + NULL string constructor  (Florian Pflug <fgp@phlo.org>)
Responses Re: Range Types - typo + NULL string constructor
List pgsql-hackers
On Wed, 2011-09-21 at 17:20 +0200, Florian Pflug wrote:
> Hm, so we'd have
> 
>   '(X,)' for range(X, NULL, '()'),
>   '(,X)' for range(NULL, X, '()') and
>   '(,)' for range(NULL, NULL, '()').
> 
> We'd then have the choice of either declaring
> 
>   '(X,]' to mean '(X,)',
>   '[,X)' to mean '(,X)' and
>   '[,]' to mean '(,)'
> 
> or to forbid the use of '[' and ']' for unspecified bounds.

Right now, I just canonicalize it to round brackets if infinite. Seems
pointless to reject it, but I can if someone thinks it's better.

> (Leaving out the ',' in the case of only one bound as in my reply to Robert's
> mail somewhere else in this thread doesn't actually work, since it'd be 
> ambiguous whether '(X)' means range(X, NULL, '()') or range(NULL, X, '()').)
> 
> One nice property is that, apart from the different brackets used, this
> representation is identical to the one used by records while still avoiding
> the infinity vs. NULL confusion.

OK, I like that. Slightly strange to require quoting empty strings, but
not stranger than the alternatives.

While we're at it, any suggestions on the text representation of an
empty range?

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: unite recovery.conf and postgresql.conf
Next
From: Jeff Davis
Date:
Subject: Re: Range Types - typo + NULL string constructor