Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E175743CEB8 for ; Thu, 19 Jan 2012 09:40:55 -0400 (AST) Received: from exprod7og119.obsmtp.com ([64.18.2.16]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RnsEW-0008EV-57 for pgsql-bugs@postgresql.org; Thu, 19 Jan 2012 13:40:55 +0000 Received: from mail-ey0-f170.google.com ([209.85.215.170]) (using TLSv1) by exprod7ob119.postini.com ([64.18.6.12]) with SMTP ID DSNKTxgdVfSVYsCWDGO2DBzvB2qhbDQoQpft@postini.com; Thu, 19 Jan 2012 05:40:51 PST Received: by eabm6 with SMTP id m6so2262794eab.15 for ; Thu, 19 Jan 2012 05:40:36 -0800 (PST) Received: by 10.213.20.201 with SMTP id g9mr2129643ebb.43.1326980436397; Thu, 19 Jan 2012 05:40:36 -0800 (PST) Received: from [192.168.1.101] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id c16sm22461944eei.1.2012.01.19.05.40.34 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 05:40:35 -0800 (PST) Message-ID: <4F181D51.4030402@enterprisedb.com> Date: Thu, 19 Jan 2012 15:40:33 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120104 Icedove/8.0 MIME-Version: 1.0 To: Alvaro Herrera CC: kenaniah , Pg Bugs Subject: Re: BUG #6401: IS DISTINCT FROM improperly compares geomoetric datatypes References: <4F17EFA0.6050903@enterprisedb.com> <1326979145-sup-7356@alvh.no-ip.org> In-Reply-To: <1326979145-sup-7356@alvh.no-ip.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201201/137 X-Sequence-Number: 32204 On 19.01.2012 15:30, Alvaro Herrera wrote: > > Excerpts from Heikki Linnakangas's message of jue ene 19 07:25:36 -0300 2012: > >> Frankly that's such a rare corner case that I'm not very enthusiastic >> about fixing it. One idea would be to look up the type's b-tree sort >> operators, and pick the equality operator from there. But point datatype >> doesn't have b-tree sort operators, either, so it wouldn't help in this >> case. > > It doesn't have a hash opclass either, which could be used as a fallback > in case there's no btree. Point cannot obviously have a btree opclass > (no inequalities), but a hash one seems possible. It wouldn't be difficult to define b-tree operators for point, by comparing x value first, then y, or something like that. If the index operations are only used for equality lookups, it doesn't matter how the < and > are defined as long as the system is self-consistent. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com