Re: Are triggers part of the transaction block that triggered the trigger? - Mailing list pgsql-general

From Robert B. Easter
Subject Re: Are triggers part of the transaction block that triggered the trigger?
Date
Msg-id 01010615451714.09559@comptechnews
Whole thread Raw
In response to Are triggers part of the transaction block that triggered the trigger?  (Philip Hallstrom <philip@adhesivemedia.com>)
List pgsql-general
On Wednesday 03 January 2001 13:28, you wrote:
> Hi all -
>     Are triggers part of the transaction block that triggered the
> trigger?  I mean if I have a trigger that updates (an insert) a table (say
> for logging or whatever) and that insert fails will the original query the
> fired the trigger also get rolled back?

In my experience with PL/pgSQL triggers, yes.  Like, if I do RAISE EXCEPTION
in the trigger, then the whole transaction the trigger was part of gets
abort/rollback.  Some of the triggers were called recusively when the trigger
would do an update which would cause the trigger to get called again for a
different row.  An exeception in any of the recursive calls of the trigger
would rollback everything that happened recursively too.

--
-------- Robert B. Easter  reaster@comptechnews.com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

pgsql-general by date:

Previous
From: Jeff Eckermann
Date:
Subject: Help with SQL Function
Next
From: Philip Warner
Date:
Subject: Re: [HACKERS] Re: pg_dump return status..