Re: RFC: Temporal Extensions for PostgreSQL - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: RFC: Temporal Extensions for PostgreSQL
Date
Msg-id 20070217201842.GC17174@svana.org
Whole thread Raw
In response to Re: RFC: Temporal Extensions for PostgreSQL  (Warren Turkal <wt@penguintechs.org>)
List pgsql-hackers
On Sat, Feb 17, 2007 at 11:40:44AM -0700, Warren Turkal wrote:
> On Saturday 17 February 2007 09:26, Tom Lane wrote:
> > "Overlapping" is not an equality relation (it fails the transitive law),
> > so I'm not entirely sure what "unique" means in this context ... but I
> > can promise you you can't make it work with btree.
>
> There is an equality relation on periods. But it wouldn't really tell you much
> useful info, as it's not normally what you're looking for with time.

What he's referring to is that "overlaps" is not transitive. i.e. if A
overlaps B and B overlaps C then A doesn't necessarily overlap C.

However, non-overlapping intervals are stricly ordered, so if you
reject overlaps from the index then new intervals can each only be
inserted into one place. However, the locking required is probably
non-trivial.

Get unique indexes for GiST working and you're home...

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pg_restore fails with a custom backup file
Next
From: Tom Lane
Date:
Subject: Re: GiST Comparing IndexTuples/Datums