Re: Range Types: empty ranges

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Range Types: empty ranges
Дата
Msg-id 1297455273.654.9.camel@jdavis-ux.asterdata.local
обсуждение исходный текст
Ответ на Re: Range Types: empty ranges  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Range Types: empty ranges  (Nathan Boley <npboley@gmail.com>)
Список pgsql-hackers
On Fri, 2011-02-11 at 14:14 -0500, Robert Haas wrote:
> > 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.

An excellent point. Allow me to move the target a little:
 WHERE A && B AND A && C
and: WHERE A && (B INTERSECT C)

That seems like a logically sound transformation, but if (B INTERSECT C)
is empty, it relies on the empty range for those two to be equivalent.
And that would be a runtime error, caught during testing only if you're
lucky.

Now, I agree that lack of closure on UNION exhibits many of the problems
that I am pointing out related to forbidding empty ranges. However, I'm
not sure if that means we should give up on either.

Regards,Jeff Davis



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Replication server timeout patch
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Range Types: empty ranges