Re: Triggers on columns

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Triggers on columns
Дата
Msg-id m2hbvkqdqt.fsf@hi-media.com
обсуждение исходный текст
Ответ на Re: Triggers on columns  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

Robert Haas <robertmhaas@gmail.com> writes:
> By the way, I completely agree that it would be useful to have a way
> to suppress triggers from firing when no columns were actually
> modified.  
 http://www.postgresql.org/docs/8.4/static/functions-trigger.html
 Currently PostgreSQL provides one built in trigger function, suppress_redundant_updates_trigger, which will prevent
anyupdate that does not actually change the data in the row from taking place, in contrast to the normal behaviour
whichalways performs the update regardless of whether or not the data has changed. (This normal behaviour makes updates
runfaster, since no checking is required, and is also useful in certain cases.)
 
 ...
 The suppress_redundant_updates_trigger function can be added to a table like this:
 CREATE TRIGGER z_min_update  BEFORE UPDATE ON tablename FOR EACH ROW EXECUTE PROCEDURE
suppress_redundant_updates_trigger();

Regards,
-- 
dim


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Triggers on columns
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Triggers on columns