Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type? - Mailing list pgsql-general

From Tom Lane
Subject Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?
Date
Msg-id 6733.1442500446@sss.pgh.pa.us
Whole thread Raw
In response to Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?
List pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 09/17/2015 06:54 AM, Tom Lane wrote:
>> Well, that's true: the parser actually looks up the operator named "<>"
>> for the given data types, and IS DISTINCT FROM is just a prefilter on
>> that to do the right thing with nulls.  So because type point has an
>> operator that's physically named "<>", that case works.

> If you use '<>' explicitly, otherwise:
> test=> select '(1,2)'::point is distinct from '(1,3)'::point;
> ERROR:  operator does not exist: point = point

Ah, sorry, actually what IS [NOT] DISTINCT FROM looks up is the "="
operator.  The core point remains, though, that this is a name-based
lookup rather than an opclass-based one.  I'd like to get us moved
over to using opclass-based lookups for all cases where the system
currently assumes that operators named "=" or "<>" necessarily behave
in a particular way.  However, that would leave point and some of the
other weirder datatypes even further out in the cold than they are now.

            regards, tom lane


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?
Next
From: Adrian Klaver
Date:
Subject: Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?