Re: Range Types: empty ranges

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Range Types: empty ranges
Date: 2011-02-11 19:14:36
Message-ID: AANLkTintzYRJGvKV+2M=eFC+v9gMkH-Vot9Mgx5=Xqo-@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 11, 2011 at 2:06 PM, Jeff Davis <pgsql(at)j-davis(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-02-11 19:15:59 Re: ALTER EXTENSION UPGRADE, v3
Previous Message David E. Wheeler 2011-02-11 19:12:35 Re: ALTER EXTENSION UPGRADE, v3