Обсуждение: rules vs triggers

Поиск
Список
Период
Сортировка

rules vs triggers

От
admin
Дата:
After reading chapters 8 and 13 of the Programmer's Guide, I thought I
understood the pros and cons of using rules vs triggers. After writing my
own, I'm still not sure I understand.

For example, lets take the check_primary_key() function in the referential
integrity trigger [contrib/spi/refint.c]. The same code could've been
written using rules since there is no need for checking validity. I
thought the rule of thumb was: "use rules as much as possible, unless you
need to check for valid values." -- my understanding

I seem to be missing a few valuable points about rules and triggers, I'd
appreciate if someone could nudge me in the right direction.

Marc