Trigger function that works with both updates and deletes?

Поиск
Список
Период
Сортировка
От novnov
Тема Trigger function that works with both updates and deletes?
Дата
Msg-id 11186941.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: Trigger function that works with both updates and deletes?  (Michael Fuhr <mike@fuhr.org>)
Re: Trigger function that works with both updates and deletes?  ("Harvey, Allan AC" <HarveyA@OneSteel.com>)
Список pgsql-general
Most of the trigger fuctions I've written work on new and updated records
referencing NEW. etc. I will need some of the trigger functions to work with
record deletions too.

First, when a record is being deleted, OLD refers to the rec just deleted
(or about to be deleted)?

Second, while I could write two trigger functions, one dealing with
add/update, the other with deletes, it's probably neater to have a single
trigger function and have it discriminate "am I being called for a delete,
or an add/update?" I don't know how to determine the type record change.
--
View this message in context:
http://www.nabble.com/Trigger-function-that-works-with-both-updates-and-deletes--tf3943732.html#a11186941
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: statistics monitoring performance improvment -- 8.1 as well as 8.2 ?
Следующее
От: Noah Heusser
Дата:
Сообщение: Dynamic Log tigger (plpgsql)