Re: Ranges for well-ordered types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Ranges for well-ordered types
Date
Msg-id 690.1149956993@sss.pgh.pa.us
Whole thread Raw
In response to Re: Ranges for well-ordered types  ("Ian Caulfield" <ian.caulfield@gmail.com>)
List pgsql-hackers
"Ian Caulfield" <ian.caulfield@gmail.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


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: How to avoid transaction ID wrap
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Latest timezone data in 8.1.4