Hello,
I try to create an unique index for a (time)period, and my goal is to
prevent two overlapping periods in a row.
For this I created a type with following command:
CREATE TYPE period AS
(first timestamp with time zone,
next timestamp with time zone);
To use the btree index I added
In article 20090820065819.ga2...@gheift.kawo1.rwth-aachen.de,
Gerhard Heift ml-postgresql-20081012-3...@gheift.de writes:
Hello,
I try to create an unique index for a (time)period, and my goal is to
prevent two overlapping periods in a row.
...
Is there another solution to solve my
Gerhard Heift ml-postgresql-20081012-3...@gheift.de writes:
I try to create an unique index for a (time)period, and my goal is to
prevent two overlapping periods in a row.
To use the btree index I added a compare function:
return
CASE
WHEN $1.next = $2.first THEN -1
On Thu, Aug 20, 2009 at 3:14 PM, Tom Lanet...@sss.pgh.pa.us wrote:
I don't believe it is possible to use a btree index for this purpose,
because there just isn't a way to express overlaps as a total order.
That's true for the general case of indexing ranges but I don't think
that's true for the
Greg Stark gsst...@mit.edu writes:
On Thu, Aug 20, 2009 at 3:14 PM, Tom Lanet...@sss.pgh.pa.us wrote:
I don't believe it is possible to use a btree index for this purpose,
because there just isn't a way to express overlaps as a total order.
That's true for the general case of indexing ranges
On Thu, 2009-08-20 at 13:35 +0200, Harald Fuchs wrote:
Have a look at http://pgfoundry.org/projects/temporal
The temporal project on pgfoundry only provides the time period type,
which is (hopefully) useful, but it does not help with a non-overlapping
constraint.
Please see my other project