Re: Ranges for well-ordered types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ian Caulfield" <ian(dot)caulfield(at)gmail(dot)com>
Cc: "Michael Glaesemann" <grzm(at)seespotcode(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Ranges for well-ordered types
Date: 2006-06-10 16:29:53
Message-ID: 690.1149956993@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-10 16:31:08 Re: Latest timezone data in 8.1.4
Previous Message Tom Lane 2006-06-10 16:23:06 Re: ADD/DROP INHERITS