Re: Comments on Exclusion Constraints and related datatypes

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Comments on Exclusion Constraints and related datatypes
Дата
Msg-id 1269288173.8481.1778.camel@ebony
обсуждение исходный текст
Ответ на Re: Comments on Exclusion Constraints and related datatypes  (David Fetter <david@fetter.org>)
Ответы Re: Comments on Exclusion Constraints and related datatypes
Список pgsql-hackers
On Mon, 2010-03-22 at 10:55 -0700, David Fetter wrote:
> On Mon, Mar 22, 2010 at 01:46:51PM -0400, Tom Lane wrote:
> > David Fetter <david@fetter.org> writes:
> > > I'm seeing a lot of places where this might be documented.  Any ideas
> > > as to which ones are appropriate?
> > 
> > I would think "Geometric Functions and Operators" would be the most
> > appropriate spot ...
> 
> Please find patch enclosed. :)

I think you've missed my point. I don't suppose anybody would disagree
that box '((0,0),(1,1))' && box '((0,0),(2,2))' is true. The fact that
these two boxes share the point (0,0) has nothing to do with the obvious
fact that the larger box completely contains the smaller one.

What I was talking about was that box '((0,0),(1,1))' && box
'((1,1),(2,2))' returns true, even though they touch at only a single
point, and share zero area.

Perhaps the end result here is the realisation that a normal search
operator like overlaps (&&) might not be the right operator to use for
exclusion constraints. For the latter, we might want something that
defines the left and bottom edges of a box to belong to the box (>=),
whereas the top edges are the boundary but do not belong to the box
itself (<). In a timerange that might be easier to visualise: the start
timestamp is inclusive, the end timestamp is exclusive, so that each
timestamp exists in only one timerange when the timeranges are
overlapping with no gaps.

-- Simon Riggs           www.2ndQuadrant.com



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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Comments on Exclusion Constraints and related datatypes
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Comments on Exclusion Constraints and related datatypes