On Fri, 4 Apr 2003, Dennis Gearon wrote:
> After reading the manual, this point didn't seem to have been made. Trigger
> fucntions are supposed to return OPAQUE, (i.e. 'void' in 'C/++' syntax). But the
That's not what opaque means, or more precisely not only what opaque means
(it also is rows from triggers, internal values like C strings and
probably some other things). In 7.4, triggers return trigger.
> manuals also say that BEFORE triggers can return NULL to avoid the INSERT or
> UPDATE from occurring. Is this contradictory? Is that actually ONE way to avoid
> a UPDATE or INSERTION from happening?
>
> BEFORE TRIGGERS
> Can change the values in the NEW Tuple for:
> INSERTS and UPDATES.
> Can void the action of:
> INSERTS and UPDATES
> by returning NULL. (does this kill the transaction?)
The action is ignored (for this row), but it's not an error condition and
doesn't kill the transaction.
> ALL TRIGGERS
> Are not DEFERRABLE in anyway. They happen immediately:
> AFTER or BEFORE each ROW is acted upon.
IIRC after triggers are run after the statement mods are completed so I
think right now it's
before triggers row1
row1
before triggers row2
row2
after triggers row1
after triggers row2