Triggers and Transactions

Started by Chris Colemanalmost 20 years ago2 messagesgeneral
Jump to latest
#1Chris Coleman
chris@karumbo.com

Hi,

I have a question about how much of a trigger is in a transaction.
I've read the docs and googled around but can't seem to find a
concrete answer.

I have two triggers that are designed to work together, one is a
before trigger and one is an after. If the before trigger succeeds
then it will have made some changes to one of my tables, however if
the after one fails some how (elog(ERROR, "")? then I would like to
rollback the changes of the before one as well as any made by the
after one too.

Is this possible?

Many thanks

Chris Coleman.

#2Terry Lee Tucker
terry@esc1.com
In reply to: Chris Coleman (#1)
Re: Triggers and Transactions

On Thursday 20 April 2006 12:25 pm, "Chris Coleman" <chris@karumbo.com> thus
communicated:
--> Hi,
-->
--> I have a question about how much of a trigger is in a transaction.
--> I've read the docs and googled around but can't seem to find a
--> concrete answer.
-->
--> I have two triggers that are designed to work together, one is a
--> before trigger and one is an after. If the before trigger succeeds
--> then it will have made some changes to one of my tables, however if
--> the after one fails some how (elog(ERROR, "")? then I would like to
--> rollback the changes of the before one as well as any made by the
--> after one too.
-->
--> Is this possible?
-->
--> Many thanks
-->
--> Chris Coleman.
-->
--> ---------------------------(end of broadcast)---------------------------
--> TIP 6: explain analyze is your friend
-->

The whole process is in a transaction and all of it will be rolled back.