The suppress_redundant_updates_trigger() works incorrectly

Поиск
Список
Период
Сортировка
От KaiGai Kohei
Тема The suppress_redundant_updates_trigger() works incorrectly
Дата
Msg-id 4911686F.3010405@ak.jp.nec.com
обсуждение исходный текст
Ответы Re: The suppress_redundant_updates_trigger() works incorrectly  (Andrew Dunstan <andrew@dunslane.net>)
Список 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 по дате отправления:

Предыдущее
От: Bernd Helmle
Дата:
Сообщение: Re: Questions about patch "Table command"
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Synchronous replication patch v1