Re: can a trigger on insert -> update other tables?

Поиск
Список
Период
Сортировка
От brichard@cafod.org.uk (Bruce Richardson)
Тема Re: can a trigger on insert -> update other tables?
Дата
Msg-id 20010303140818.B25166@usb.cafod.org.uk
обсуждение исходный текст
Ответ на can a trigger on insert -> update other tables?  (will trillich <will@serensoft.com>)
Ответы Re: can a trigger on insert -> update other tables?
Список pgsql-general
On Fri, Mar 02, 2001 at 03:13:19PM -0600, will trillich wrote:
> i've got a "_rating" table that, when a new record is added,
> i'd like to have propagate through some other tables to update
> running totals:
>
> CREATE FUNCTION _rating_propagate( _rating ) RETURNS OPAQUE AS '

Trigger functions shouldn't have parameters.  And you don't need the NEW
in this line:
>     FOR EACH ROW EXECUTE PROCEDURE _rating_propagate( NEW );

The new variable is automatically made available to the trigger
function.

And remember to do
    RETURN new
somewhere.


--
Bruce

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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Trigger Blunder
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Connection/closedown triggers for backends?