Re: Range Types: empty ranges

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Range Types: empty ranges
Date: 2011-02-11 22:39:42
Message-ID: 20110211223942.GB8305@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 11, 2011 at 10:11:45AM -0800, Jeff Davis wrote:
> The cost, of course, is that not all operations are well-defined for
> empty ranges. I think those are mostly operators like those mentioned in
> the other thread: ">>" (strictly right of), "<<" (strictly left of), and
> "-|-" (adjacent); and perhaps "&>" and "&<". These are probably used a
> little less frequently, and should probably not be used in a context
> where empty ranges are permitted (if they are, it's likely a mistake and
> an error should be thrown).

But surely this is just a matter of your definitions? If you define
"A strictly left of B" as "all points in A are less than all points in
B", then you might have a problem with "all points" of an empty range.

If you define it as "not (any points in A to the right of any points in
B)" then the answer for an empty range is well defined (namely true).

I think once you make workable definitions then empty ranges should
pose no problems. Sure, it may be that an empty range will be both to
the left and to the right of every other set. That doesn't make it
wrong.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first.
> - Charles de Gaulle

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nicolas Barbier 2011-02-11 22:49:27 Re: Sorting. When?
Previous Message Martijn van Oosterhout 2011-02-11 22:22:55 Re: Debian readline/libedit breakage