Re: update trigger not working

Поиск
Список
Период
Сортировка
От Douglas McNaught
Тема Re: update trigger not working
Дата
Msg-id m2wtk8ucf5.fsf@Douglas-McNaughts-Powerbook.local
обсуждение исходный текст
Ответ на update trigger not working  (CSN <cool_screen_name90001@yahoo.com>)
Список pgsql-general
CSN <cool_screen_name90001@yahoo.com> writes:

> I'm trying to set up a trigger that simply updates a
> field's corresponding timestamp to now() whenever the
> field is updated. But it's not working. Trying to
> debug, I commented out the inner IF and END and the
> log seemed to indicate infinite recursion occurred. My
> next guess is that perhaps NULL's in OLD.stuff is
> causing the IF to behave other than what I expect.

Make it a BEFORE UPDATE trigger and just set NEW.stuff_ts to now(),
rather than doing another query inside the trigger function.

-Doug

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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: update trigger not working
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [pgsql-advocacy] Oracle buys Innobase