Re: Range Types: empty ranges

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Range Types: empty ranges
Дата
Msg-id AANLkTintzYRJGvKV+2M=eFC+v9gMkH-Vot9Mgx5=Xqo-@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Range Types: empty ranges  (Jeff Davis <pgsql@j-davis.com>)
Список 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 по дате отправления:

Предыдущее
От: "David E. Wheeler"
Дата:
Сообщение: Re: ALTER EXTENSION UPGRADE, v3
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ALTER EXTENSION UPGRADE, v3