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

Поиск
Список
Период
Сортировка
От Robert B. Easter
Тема Re: Are triggers part of the transaction block that triggered the trigger?
Дата
Msg-id 01010615451714.09559@comptechnews
обсуждение исходный текст
Ответ на Are triggers part of the transaction block that triggered the trigger?  (Philip Hallstrom <philip@adhesivemedia.com>)
Список 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 по дате отправления:

Предыдущее
От: Jeff Eckermann
Дата:
Сообщение: Help with SQL Function
Следующее
От: Philip Warner
Дата:
Сообщение: Re: [HACKERS] Re: pg_dump return status..