Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-03-11 Thread Christopher Browne
On Fri, Mar 11, 2011 at 12:37 PM, Jeff Davis wrote: > Right now it's #3, and I lean pretty strongly toward keeping it. Without > #3, people will get confused when fairly simple operations fail in a > data-dependent way (at runtime). With #3, people will run into problems > only in situations where

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-03-11 Thread Jeff Davis
On Fri, 2011-03-11 at 08:37 -0500, Bruce Momjian wrote: > Where are we on this? The options are: 1. Rip out empty ranges. Several people have been skeptical of their usefulness, but I don't recall anyone directly saying that they should be removed. Robert Haas made the point that range types aren

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-03-11 Thread Bruce Momjian
Where are we on this? --- Erik Rijkers wrote: > On Wed, February 9, 2011 09:35, Jeff Davis wrote: > > Updated patch. > > > > The operators << >> and -|- have the following behavior with empty ranges: > > testdb=# selec

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Kevin Grittner
Josh Berkus wrote: > I can imagine using all of these constructs in actual > applications. But which of them, if any, is an "empty range"? -Kevin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Erik Rijkers
On Fri, February 11, 2011 19:02, Josh Berkus wrote: > >> "empty range" >> = >> Zero length? >> If so, is it fixed at some point, but empty? >> '(x,x)'? >> '[x,x)'? > > Neither of the above should be possible, I think. The expression "(x" > logically excludes the expression "x

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Josh Berkus
> "empty range" > = > Zero length? > If so, is it fixed at some point, but empty? > '(x,x)'? > '[x,x)'? Neither of the above should be possible, I think. The expression "(x" logically excludes the expression "x)". However, "[x,x]" would be valid, and would be a zero-length

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Andrew Dunstan
On 02/11/2011 12:36 PM, Robert Haas wrote: On Fri, Feb 11, 2011 at 12:26 PM, Jeff Davis wrote: On Fri, 2011-02-11 at 12:03 -0500, Robert Haas wrote: For what it's worth, my completely uninformed opinion is that comparison operators shouldn't error out. I haven't read the patch so I'm not su

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Kevin Grittner
Jeff Davis wrote: > ">>" means "strictly right of" > "<<" means "strictly left of" > "-|-" means "adjacent" (touching but not overlapping) > > I'm open to suggestion about how those behave with empty ranges. OK, that still leaves a lot to the imagination, though. To try to clarify in *my* mi

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Robert Haas
On Fri, Feb 11, 2011 at 12:26 PM, Jeff Davis wrote: > On Fri, 2011-02-11 at 12:03 -0500, Robert Haas wrote: >> For what it's worth, my completely uninformed opinion is that >> comparison operators shouldn't error out.  I haven't read the patch so >> I'm not sure what those operators are defined to

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Jeff Davis
On Fri, 2011-02-11 at 12:03 -0500, Robert Haas wrote: > For what it's worth, my completely uninformed opinion is that > comparison operators shouldn't error out. I haven't read the patch so > I'm not sure what those operators are defined to do, though. ">>" means "strictly right of" "<<" means "s

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Robert Haas
On Fri, Feb 11, 2011 at 11:55 AM, Jeff Davis wrote: > On Fri, 2011-02-11 at 15:09 +0100, Erik Rijkers wrote: >> On Wed, February 9, 2011 09:35, Jeff Davis wrote: >> > Updated patch. >> > >> >> The operators  <<  >>  and -|-  have the following behavior with empty >> ranges: >> >> testdb=# select

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Jeff Davis
On Fri, 2011-02-11 at 15:09 +0100, Erik Rijkers wrote: > On Wed, February 9, 2011 09:35, Jeff Davis wrote: > > Updated patch. > > > > The operators << >> and -|- have the following behavior with empty ranges: > > testdb=# select '-'::int4range << range(200,300); > ERROR: empty range > testdb

Re: [HACKERS] Range Types: << >> -|- ops vs empty range

2011-02-11 Thread Erik Rijkers
On Wed, February 9, 2011 09:35, Jeff Davis wrote: > Updated patch. > The operators << >> and -|- have the following behavior with empty ranges: testdb=# select '-'::int4range << range(200,300); ERROR: empty range testdb=# select '-'::int4range >> range(200,300); ERROR: empty range testdb=#