Re: Box type equality

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stanislav Kelvich <s(dot)kelvich(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Box type equality
Date: 2015-09-29 15:43:07
Message-ID: 15434.1443541387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stanislav Kelvich <s(dot)kelvich(at)postgrespro(dot)ru> writes:
> I've faced an issue with Box type comparison that exists almost for a five years.

Try twenty-five years. The code's been like that since Berkeley.

> That can be fixed by b-tree equality for boxes, but we need some
> decisions there.

The problem with inventing a btree opclass for boxes is much more
fundamental than fuzzy comparisons, unfortunately. Btree requires a
linear sort order, and there's no plausible linear ordering of boxes,
unless you compare areas which won't give the equality semantics you want.

We could perhaps invent an exact-equality operator and construct just
a hash opclass for it, no btree.

In any case I think it would be a mistake to consider only boxes; all
the built-in geometric types have related issues.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-09-29 16:02:59 Re: GinPageIs* don't actually return a boolean
Previous Message Andrew Dunstan 2015-09-29 15:36:36 Re: No Issue Tracker - Say it Ain't So!