Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce4Ks-00022d-Pc for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Feb 2017 18:29:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ce4Ks-0006uI-Cf for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Feb 2017 18:29:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ce4KD-0005La-4i for pgsql-bugs@postgresql.org; Wed, 15 Feb 2017 18:29:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ce4K6-0003qq-LB for pgsql-bugs@postgresql.org; Wed, 15 Feb 2017 18:29:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v1FIT0EW019361; Wed, 15 Feb 2017 13:29:00 -0500 From: Tom Lane To: kcwitt@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14546: "point" type does not work with "IS DISTINCT" In-reply-to: <20170215091408.6099.42167@wrigleys.postgresql.org> References: <20170215091408.6099.42167@wrigleys.postgresql.org> Comments: In-reply-to kcwitt@gmail.com message dated "Wed, 15 Feb 2017 09:14:08 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19359.1487183340.1@sss.pgh.pa.us> Date: Wed, 15 Feb 2017 13:29:00 -0500 Message-ID: <19360.1487183340@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org kcwitt@gmail.com writes: > Whatever issue there is with comparing points should be dealt with in > postgres and not pushed to client applications. The problem with this is that it's not entirely clear what definition of "equality" IS [NOT] DISTINCT FROM should use. The current definition is "use the operator named =", which is rather ad hoc, but you can point to chapter and verse in the SQL standard where X IS [NOT] DISTINCT FROM Y is defined in terms of "X = Y", so it's not completely nuts either. Personally I'd prefer it to be defined as "use the equality operator of the data type's default btree opclass, or hash opclass if no btree opclass"; but it's likely that that would break some cross-type cases that work today, so it wouldn't be a panacea. But in either case, "point" loses because it has neither an operator named "=" nor a btree or hash opclass. This is not just an oversight. There is a "point ~= point" operator but it implements fuzzy equality, making it unsuitable as a basis for btree or hash behavior, even assuming that you could invent the linear ordering of points that would also be needed for a btree opclass. It would surely not be terribly hard to invent an exact-equality "=" operator for points, but it's not clear how useful that would be. Almost all the existing operators for points are fuzzy. The same problems exist for other geometric types, usually worse, because many of the others do have "=" operators but they compare areas :-(. Nobody's really wanted to break backwards compatibility enough to bring some sanity to that mess. Short answer is I don't think this is likely to change in the near future. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs