Cascading Trigger Prevention

Поиск
Список
Период
Сортировка
От JonXP
Тема Cascading Trigger Prevention
Дата
Msg-id 05d292fb-bbfa-4737-8280-37e883e43c92@a35g2000prf.googlegroups.com
обсуждение исходный текст
Ответы Re: Cascading Trigger Prevention
Список pgsql-general
Hello All,

I have a table that contains a nested set (using paths), and I'm
trying to create a trigger that updates the timestamps of a node and
all of its parents on a modification.  Unfortunately, this is causing
infinitely recurring triggers.

The insert occurs, which fires the trigger, which then updates all of
the parent rows, which then fires the trigger again for each update,
which recurses yet again.

I have been looking with no success for a way to turn off triggers,
and am surprised that there is no method of preventing a trigger from
running when performing a query.  Even more bothersome is the fact
that a trigger has no way of knowing when it has been called by
another trigger.

I don't want to have to move my modified timestamps to a separate
table just so that the triggers don't recurse themselves, but this is
looking like it will be the case.

Does anyone have any thoughts or alternate suggestions?

В списке pgsql-general по дате отправления:

Предыдущее
От: "Sebastian - Anton PONOVESCU"
Дата:
Сообщение: certificate based authorization
Следующее
От: "Willy-Bas Loos"
Дата:
Сообщение: Re: 1 cluster on several servers