Preventing an 'after' trigger from causing rollback on error - Mailing list pgsql-general

From Eliot Gable
Subject Preventing an 'after' trigger from causing rollback on error
Date
Msg-id CAD-6L_Xc3xL0uFTpty79vyTjUdyKew=BtP07AtOGOgVYkku50w@mail.gmail.com
Whole thread Raw
Responses Re: Preventing an 'after' trigger from causing rollback on error  (Jeff Davis <pgsql@j-davis.com>)
Re: Preventing an 'after' trigger from causing rollback on error  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
Is there any way I can stop a trigger which fires after a row is inserted into a table from causing a rollback of the entire transaction if something goes wrong?

I have rows being written to a table, and I have triggers which calculate and update statistics automatically in stats tables based on the rows inserted. However, if something goes wrong in that trigger, right now it causes all the inserts to roll back, as well as the stats calculations. I would rather keep all the inserts, but just fail the stats calculates. I can always rematerialize the entire stats table with another procedure if all the rows are present.

Thanks in advance for any assistance.


--
Eliot Gable

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Tab completion not working on OSX Lion (10.7.3)
Next
From: Jeff Davis
Date:
Subject: Re: Preventing an 'after' trigger from causing rollback on error