Re: [SQL] Index to enforce non-overlapping ranges?

2008-05-08 Thread Chris Browne
[EMAIL PROTECTED] (James Robinson) writes: > Academic question here: > > 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? Such as: > > create table test > ( >

Re: [SQL] Index to enforce non-overlapping ranges?

2008-05-08 Thread Tom Lane
James Robinson <[EMAIL PROTECTED]> 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

[SQL] Index to enforce non-overlapping ranges?

2008-05-08 Thread James Robinson
Academic question here: 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? Such as: create table test ( id int not null primary key, lo