I have 2 triggers on one table; one works for INSERTs :
CREATE TRIGGER "get_user_name"
AFTER INSERT ON "field_data"
FOR EACH ROW EXECUTE PROCEDURE "add_info"();
This updates some values in the table.
And one for UPDATEs (to fill a history table):
CREATE TRIGGER "set_history"
BEFORE UPDATE ON "field_data"
FOR EACH ROW EXECUTE PROCEDURE "gener_history"();
The problem is that when I insert a new row in the table the procedure "add_info"()
makes an update and therefore fires the second trigger, which ends with an error:
ERROR: record "new" has no field "field1"
How can I avoid this?
update
a row? I'd expect the same error.