"Mitch Vincent" <mitch@venux.net> writes:
> I'm using this funtion via a trigger to total up amounts in several fields
> (and adding that value into a total field)..
> CREATE TRIGGER invoice_total_trigger AFTER INSERT OR UPDATE ON invoice
> FOR EACH ROW EXECUTE PROCEDURE invoice_total_trigger();
> It works for updating but not when you insert a new row. Am I doing it
> wrong?
Er, don't you want BEFORE INSERT OR UPDATE?
I wouldn't think an AFTER trigger could modify the already-inserted-or-
updated row...
regards, tom lane