On Sun, Mar 27, 2005 at 07:28:21PM -0500, Kyrill Alyoshin wrote: > > I cannot get AFTER INSERT (or UPDATE for that matter) triggers to work. > The same code works perfectly fine for BEFORE triggers.
You're trying to modify the record but it's too late in an AFTER trigger. See the "Triggers" chapter in the documentation: The return value is ignored for row-level triggers fired after an operation, and so they may as well return NULL. The PL/pgSQL "Trigger Procedures" section repeats the above: The return value of a BEFORE or AFTER statement-level trigger or an AFTER row-level trigger is always ignored; it may as well be null. http://www.postgresql.org/docs/8.0/interactive/triggers.html http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings