Re: Trigger loop question

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Trigger loop question
Дата
Msg-id 12928.1079412134@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Trigger loop question  (Mike Nolan <nolan@gw.tssi.com>)
Ответы Re: Trigger loop question  (Mike Nolan <nolan@gw.tssi.com>)
Список pgsql-general
Mike Nolan <nolan@gw.tssi.com> writes:
> Yes it does.  OK, that means Tom's original suggestion of checking
> the other table for the same value before updating it should prevent
> an infinite loop, providing that's done from a pair of 'after update'
> triggers, using the NEW.column entries in the triggered table to update
> the other table.

Actually, I wasn't thinking very clearly.  The easiest way to break
the loop is to avoid updating the other table when OLD.x = NEW.x
in the trigger's arguments.  The other way requires a rather-redundant
SELECT to see what is in the other table.

            regards, tom lane

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

Предыдущее
От: Stephen Robert Norris
Дата:
Сообщение: Re: Data Corruption in case of abrupt failure
Следующее
От: Mike Nolan
Дата:
Сообщение: Re: Trigger loop question