Re: Range Types - typo + NULL string constructor

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types - typo + NULL string constructor
Date: 2011-09-21 17:00:39
Message-ID: 1316624439.7281.214.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2011-09-21 17:02:32 Re: Range Types - typo + NULL string constructor
Previous Message Robert Haas 2011-09-21 16:57:46 Re: unite recovery.conf and postgresql.conf