Jamie Deppeler wrote:
Hi,

having a small problem in a trigger i want to automatically update a date field but when i use for example

update table
set field = current_date
where table.pk = new.pk

If "table" is the table with the trigger on it, you'll end up with an endless loop, since the trigger will keep firing itself.


In a BEFORE trigger, just update NEW and make sure you return NEW. Look at the example in the manual for details.

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to