Re: Range Type constructors - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Range Type constructors
Date
Msg-id 1297235391.27157.404.camel@jdavis
Whole thread Raw
In response to Re: Range Type constructors  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: Range Type constructors  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Wed, 2011-02-09 at 15:39 +0900, Itagaki Takahiro wrote:
> On Wed, Feb 9, 2011 at 14:50, Jeff Davis <pgsql@j-davis.com> wrote:
> > 1.
> > The obvious constructor would be:
> >  range(1, 10)
> > But is that [1, 10), (1, 10], (1, 10), or [1, 10]? We need to support
> > all 4, and it's not obvious how to do that easily.
> 
> here is the same issue in table partitioning. Also, We might use the
> syntax for our partitioning in the future.  Just for reference,
> DB2 uses EXCLUSIVE and INCLUSIVE keywords to specify boundaries.
> 
>   CREATE TABLE ... PARTITION BY RANGE (...)
>     (STARTING 0 EXCLUSIVE ENDING 100 INCLUSIVE)

Interesting. It needs to be usable in normal expressions, however, so it
may require some adaptation.

That's how arrays do it: there's a special Expr node that represents an
array expression. Maybe the same thing could be used for range types,
but I fear that there may be some grammar conflicts. I doubt we'd want
to fully reserve the keyword "range".

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: SQL/MED - file_fdw
Next
From: Jeff Davis
Date:
Subject: Range Types - representation and alignment