The suppress_redundant_updates_trigger() works incorrectly - Mailing list pgsql-hackers

From KaiGai Kohei
Subject The suppress_redundant_updates_trigger() works incorrectly
Date
Msg-id 4911686F.3010405@ak.jp.nec.com
Whole thread Raw
Responses Re: The suppress_redundant_updates_trigger() works incorrectly
List pgsql-hackers
Hi,

The suppress_redundant_updates_trigger() works incorrectly
on the table defined with "WITH_OIDS" option.

----------
(*) The latest 8.4devel tree without SE-PostgreSQL patch

postgres=# CREATE TABLE min_updates_test (              f1 text,              f2 int,              f3 int) with oids;
CREATE TABLE           ^^^^^^^^^ <- Here is different from the regression test.
postgres=# INSERT INTO min_updates_test VALUES ('a',1,2),('b','2',null);
INSERT 0 2
postgres=# CREATE TRIGGER z_min_update          BEFORE UPDATE ON min_updates_test          FOR EACH ROW EXECUTE
PROCEDUREsuppress_redundant_updates_trigger();
 
CREATE TRIGGER
postgres=# UPDATE min_updates_test SET f1 = f1;
UPDATE 2
----------

The current version does not allow to update the "oid", so the older
value is preserved implicitly. However, it is done at heap_update().
Before-row-trigger functions are invoked before heap_update(), so
the field to store the "oid" is empty (InvalidOid) at the moment.
Then, suppress_redundant_updates_trigger() makes a decision there is
a difference between old and new versions.

It seems to me the older value has to be preserved just before
invocation of row-trigger functions.
Any comment?

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai@ak.jp.nec.com>


pgsql-hackers by date:

Previous
From: Bernd Helmle
Date:
Subject: Re: Questions about patch "Table command"
Next
From: Simon Riggs
Date:
Subject: Re: Synchronous replication patch v1