Re: Triggers on columns - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: Triggers on columns
Date
Msg-id m2hbvkqdqt.fsf@hi-media.com
Whole thread Raw
In response to Re: Triggers on columns  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Triggers on columns
Next
From: Robert Haas
Date:
Subject: Re: Triggers on columns