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

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'pinker *EXTERN*'" <pinker(at)onet(dot)eu>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?
Date: 2015-09-17 13:32:25
Message-ID: A737B7A37273E048B164557ADEF4A58B50FA8609@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

pinker wrote:
> I've tried to write audit trigger which fires only when data changed, so I used "WHEN (OLD.* IS
> DISTINCT FROM NEW.*)" clause as described in documentation
> <http://www.postgresql.org/docs/9.4/static/sql-createtrigger.html> . Should this clause be independent
> from data type? because an error occurs when I'm trying to modify row with point data type: ERROR:
> could not identify an equality operator for type point

I guess it is dependent on data type as it requires an equality operator,
and type "point" doesn't have one.

You'd have to hand-roll a comparison in this case, probably using the
"same as" operator "~=".

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-09-17 13:39:21 Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?
Previous Message pinker 2015-09-17 13:14:15 Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type?