Re: Are triggers part of the transaction block that triggered the trigger?

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: Philip Hallstrom <philip(at)adhesivemedia(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Are triggers part of the transaction block that triggered the trigger?
Date: 2001-01-06 20:45:17
Message-ID: 01010615451714.09559@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)comptechnews(dot)com ---------
-- CompTechNews Message Board http://www.comptechnews.com/ --
-- CompTechServ Tech Services http://www.comptechserv.com/ --
---------- http://www.comptechnews.com/~reaster/ ------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alex Pilosov 2001-01-06 21:40:15 Re: Help with SQL Function
Previous Message Thomas T. Thai 2001-01-06 19:30:08 Re: XLogWrite: had to create new log file