Re: After Insert or Update Trigger Issues!

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: After Insert or Update Trigger Issues!
Дата
Msg-id 20050328020658.GA60315@winnie.fuhr.org
обсуждение исходный текст
Ответ на After Insert or Update Trigger Issues!  (Kyrill Alyoshin <kyrill@technolog.ca>)
Список pgsql-general
On Sun, Mar 27, 2005 at 07:28:21PM -0500, Kyrill Alyoshin wrote:
>
> I cannot get AFTER INSERT (or UPDATE for that matter) triggers to work.
> The same code works perfectly fine for BEFORE triggers.

You're trying to modify the record but it's too late in an AFTER
trigger.  See the "Triggers" chapter in the documentation:

  The return value is ignored for row-level triggers fired after
  an operation, and so they may as well return NULL.

The PL/pgSQL "Trigger Procedures" section repeats the above:

  The return value of a BEFORE or AFTER statement-level trigger
  or an AFTER row-level trigger is always ignored; it may as well
  be null.

http://www.postgresql.org/docs/8.0/interactive/triggers.html
http://www.postgresql.org/docs/8.0/interactive/plpgsql-trigger.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: After Insert or Update Trigger Issues!
Следующее
От: "Qingqing Zhou"
Дата:
Сообщение: Re: Debugging deadlocks