Re: Range Types: empty ranges - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Range Types: empty ranges
Date
Msg-id AANLkTintzYRJGvKV+2M=eFC+v9gMkH-Vot9Mgx5=Xqo-@mail.gmail.com
Whole thread Raw
In response to Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Fri, Feb 11, 2011 at 2:06 PM, Jeff Davis <pgsql@j-davis.com> wrote:
> On Fri, 2011-02-11 at 10:28 -0800, Josh Berkus wrote:
>> I guess I'm having trouble tying the concept of empty ranges to any
>> reality external to the database.
>
> That's true, but in the same sense as zero has no meaning outside of the
> database.
>
> It's really that it has nice mathematical properties coming from set
> theory. Take the distributive law:
>
>  A UNION (B INTERSECT C) = (A UNION B) INTERSECT (A UNION C)

But the basic range type isn't even closed under UNION.  It seems like
what you really need if you want this stuff to work out smoothly is a
MULTIRANGE type.  Then this problem goes away: the union or
intersection of two ranges is a multirange, and after that everything
is closed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: ALTER EXTENSION UPGRADE, v3
Next
From: Tom Lane
Date:
Subject: Re: ALTER EXTENSION UPGRADE, v3