| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера