"Ian Caulfield" <ian(dot)caulfield(at)gmail(dot)com> writes:
> I've done similar date range things by creating a composite type consisting
> of the lower and upper bounds, and then implementing a btree opclass where
> the comparator returns 0 if two ranges overlap - this allows a current btree
> index to enforce non-overlapping ranges, and allows indexed lookup of which
> range contains a particular value.
And how hard did you test this? Non-transitive "equality" is certain to
confuse btree, leading to wrong answers.
regards, tom lane