Peter Eisentraut <pete...@gmx.net> wrote: > Therefore, it cannot be completely unexpected if column triggers are > called even if the column was not actually changed in a semantically > significant way.
Ok, the attached patch implements standard-compliant version of column trigger. Retrieving modified columns is not so difficult as I expected. It is in: rt_fetch(relinfo->ri_RangeTableIndex, estate->es_range_table)->modifiedCols and the information are passed from caller to trigger routines. However, to be honest, I think standard-compliant column trigger is useless... I'm thinking additional extension for triggers -- if we want to check modifications of actual values, it could be defined as: CREATE TRIGGER trig BEFORE UPDATE ON tbl FOR EACH ROW WHEN (NEW.col <> OLD.col) EXECUTE PROCEDURE trigger_func(); Regards, --- ITAGAKI Takahiro NTT Open Source Software Center
standard-column-trigger-20090907.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers