Preventing an 'after' trigger from causing rollback on error

From: Eliot Gable <egable+pgsql-general(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Preventing an 'after' trigger from causing rollback on error
Date: 2012-04-13 21:58:15
Message-ID: CAD-6L_Xc3xL0uFTpty79vyTjUdyKew=BtP07AtOGOgVYkku50w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2012-04-13 23:56:42 Re: Preventing an 'after' trigger from causing rollback on error
Previous Message John R Pierce 2012-04-13 20:37:11 Re: Tab completion not working on OSX Lion (10.7.3)