Re: RI checks during UPDATEs

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: RI checks during UPDATEs
Дата
Msg-id 3C6D247A-27FD-406C-BA52-C933C4F5137F@decibel.org
обсуждение исходный текст
Ответ на RI checks during UPDATEs  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers
On Jan 30, 2007, at 1:17 PM, Simon Riggs wrote:
> It would be even better if there was some way of not executing the
> trigger at all if we knew that the UPDATE statement doesn't SET the FK
> columns.

Other databases allow you to put a WHERE or CHECK clause on triggers,  
so that they will only fire if that evaluates to true. That would  
allow FK triggers to be defined as

CREATE TRIGGER ... WHERE NEW.fk != OLD.fk

and would obviously have other uses as well. Of course the question  
is how much time that would save vs just doing the same check in the  
trigger function itself.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)




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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Proposal: Commit timestamp
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: "May", "can", "might"