From: | pinker <pinker(at)onet(dot)eu> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type? |
Date: | 2015-09-17 13:14:15 |
Message-ID: | 1442495655897-5866276.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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*Example:
CREATE TABLE IF NOT EXISTS test1( col1 POINT)WITH (OIDS =FALSE);INSERT INTO
test1 VALUES ('(0,1)');CREATE OR REPLACE FUNCTION test_update() RETURNS
TRIGGER AS $BODY$ BEGIN RETURN NEW; END; $BODY$LANGUAGE plpgsql
VOLATILECOST 100;CREATE TRIGGER trigger_update_testAFTER UPDATEON test1FOR
EACH ROWWHEN ((old.* IS DISTINCT FROM new.*))EXECUTE PROCEDURE
test_update();UPDATE test1 SET col1 = '(9,0)';
--
View this message in context: http://postgresql.nabble.com/Shouldn-t-WHEN-OLD-IS-DISTINCT-FROM-NEW-clause-be-independent-from-data-type-tp5866276.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Albe Laurenz | 2015-09-17 13:32:25 | Re: Shouldn't "WHEN (OLD.* IS DISTINCT FROM NEW.*)" clause be independent from data type? |
Previous Message | Антон Бушмелев | 2015-09-17 13:10:33 | @ operator |