The suppress_redundant_updates_trigger() works incorrectly

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: The suppress_redundant_updates_trigger() works incorrectly
Date: 2008-11-05 09:33:35
Message-ID: 4911686F.3010405@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 PROCEDURE suppress_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(at)ak(dot)jp(dot)nec(dot)com>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-11-05 10:07:24 Re: Synchronous replication patch v1
Previous Message Bernd Helmle 2008-11-05 09:23:00 Re: Questions about patch "Table command"