Re: [GENERAL] ON UPDATE trigger question

2007-09-13 Thread hubert depesz lubaczewski
On Wed, Sep 12, 2007 at 01:56:13PM -0500, Josh Trutwin wrote: > Or would you have to compare each field in OLD, NEW to see if > anything actually changed? you dont have to compare all columns (at least not in 8.2 and newer). please take a look at http://www.depesz.com/index.php/2007/09/08/avoiding

Re: [GENERAL] ON UPDATE trigger question

2007-09-12 Thread Jorge Godoy
On Wednesday 12 September 2007 15:56:13 Josh Trutwin wrote: > If I create an ON UPDATE trigger run on each row after update, does > the trigger fire only on rows affected by the update or for all rows? > > For example: > > CREATE TRIGGER my_update_trigger >AFTER UPDATE ON my_table >FOR EACH

[GENERAL] ON UPDATE trigger question

2007-09-12 Thread Josh Trutwin
If I create an ON UPDATE trigger run on each row after update, does the trigger fire only on rows affected by the update or for all rows? For example: CREATE TRIGGER my_update_trigger AFTER UPDATE ON my_table FOR EACH ROW EXECUTE PROCEDURE my_update_proc; UPDATE my_table SET my_val = my