Re: Index to enforce non-overlapping ranges?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Robinson <jlrobins(at)socialserve(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Index to enforce non-overlapping ranges?
Date: 2008-05-08 14:54:21
Message-ID: 2080.1210258461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

James Robinson <jlrobins(at)socialserve(dot)com> writes:
> Given a table with a pair of any sort of line-segment-esqe range
> delimiter columns, is it possible to build a unique index to enforce
> non-overlapping ranges?

Nope, sorry. Unique indexes enforce non-equality, but there's no way
to pretend that "overlaps" is an equality condition (hint: it's not
transitive).

I don't say that it'd be impossible to construct an index type that
could do this, but you won't get there with the pieces we have.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christian Kindler 2008-05-09 10:00:54 execute plpgsl like "normal" sql
Previous Message Chris Browne 2008-05-08 14:31:25 Re: Index to enforce non-overlapping ranges?