rules vs triggers - Mailing list pgsql-general

From admin
Subject rules vs triggers
Date
Msg-id Pine.BSF.4.10.10001150132330.86487-100000@server.b0x.com
Whole thread Raw
List pgsql-general
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


pgsql-general by date:

Previous
From: Gerald Sievers
Date:
Subject: Re: Postgresql Perl Problem
Next
From: "Oliver Elphick"
Date:
Subject: Re: [GENERAL] New To List