Re: [HACKERS] Range Type constructors

2011-02-10 Thread David E. Wheeler
On Feb 10, 2011, at 11:21 AM, Tom Lane wrote: >> It will certainly mess up syntax highlighting and matching bracket detection >> in pretty much all text editors... > > Yeah. It's a cute-looking notation but surely it will cause many more > problems than it's worth. I agree with Robert's suggest

Re: [HACKERS] Range Type constructors

2011-02-10 Thread David E. Wheeler
On Feb 10, 2011, at 10:41 AM, Jeff Davis wrote: > This might solve the constructor problem nicely if we could do things > like: > RANGE[10,20) > But I have a feeling that will either cause a bizarre problem with the > grammar, or someone will think it's not very SQL-like. I like it a lot better

Re: [HACKERS] Range Type constructors

2011-02-10 Thread Tom Lane
Florian Pflug writes: >> This might solve the constructor problem nicely if we could do things >> like: >> RANGE[10,20) >> But I have a feeling that will either cause a bizarre problem with the >> grammar, or someone will think it's not very SQL-like. > It will certainly mess up syntax highlighti

Re: [HACKERS] Range Type constructors

2011-02-10 Thread Florian Pflug
> This might solve the constructor problem nicely if we could do things > like: > RANGE[10,20) > But I have a feeling that will either cause a bizarre problem with the > grammar, or someone will think it's not very SQL-like. It will certainly mess up syntax highlighting and matching bracket dete

Re: [HACKERS] Range Type constructors

2011-02-10 Thread Robert Haas
On Thu, Feb 10, 2011 at 1:41 PM, Jeff Davis wrote: > This might solve the constructor problem nicely if we could do things > like: >  RANGE[10,20) > But I have a feeling that will either cause a bizarre problem with the > grammar, or someone will think it's not very SQL-like. I think won't cause

Re: [HACKERS] Range Type constructors

2011-02-10 Thread Jeff Davis
On Thu, 2011-02-10 at 13:07 -0500, Robert Haas wrote: > According to our documentation[1], RANGE is reserved in SQL:2008 and > SQL:2003, which makes it more imaginable to reserve it than it would > be otherwise. Oh, interesting. > I believe that in a previous email you mentioned that > you were h

Re: [HACKERS] Range Type constructors

2011-02-10 Thread Robert Haas
On Wed, Feb 9, 2011 at 2:09 AM, Jeff Davis wrote: > 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 keywor

Re: [HACKERS] Range Type constructors

2011-02-08 Thread Jeff Davis
On Wed, 2011-02-09 at 15:39 +0900, Itagaki Takahiro wrote: > On Wed, Feb 9, 2011 at 14:50, Jeff Davis 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 easil

Re: [HACKERS] Range Type constructors

2011-02-08 Thread Itagaki Takahiro
On Wed, Feb 9, 2011 at 14:50, Jeff Davis 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 th

[HACKERS] Range Type constructors

2011-02-08 Thread Jeff Davis
There are two issues I'd like to discuss related to constructing range types from other values. 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. The solution that I came up