Alban Hertroys <alban@xxxxxxxxxxxxxxxxx> writes: > Are you refering to a 'timespan' data type that can be determined to be > unique? > I can see some problems there, as both value and range matter; it'd be > similar to determining the uniqueness of an area in a rectangle (though > 1 dimensional only, of course). Except that what you want is to forbid overlap, not forbid equality. This is not possible with btree-based unique indexes, because btree will not like an opclass whose "equality" member is not transitive. If you look in the archives you'll find previous discussion of this point, including some blue-sky speculation about whether GiST indexes could be made to serve the purpose. That's a long way from being a solution you could use today, though. regards, tom lane