Hi,
Robert Haas <robertmhaas@gmail.com> writes:
> By the way, I completely agree that it would be useful to have a way
> to suppress triggers from firing when no columns were actually
> modified.
http://www.postgresql.org/docs/8.4/static/functions-trigger.html
Currently PostgreSQL provides one built in trigger function, suppress_redundant_updates_trigger, which will prevent
anyupdate that does not actually change the data in the row from taking place, in contrast to the normal behaviour
whichalways performs the update regardless of whether or not the data has changed. (This normal behaviour makes updates
runfaster, since no checking is required, and is also useful in certain cases.)
...
The suppress_redundant_updates_trigger function can be added to a table like this:
CREATE TRIGGER z_min_update BEFORE UPDATE ON tablename FOR EACH ROW EXECUTE PROCEDURE
suppress_redundant_updates_trigger();
Regards,
--
dim