On Mon, 19 Nov 2001, Tom Lane wrote:
> <cnliou@eurosport.com> writes:
> > Am I asking for too much, or RI and triggers were not
> > designed for operations like this example in the
> > first place?
>
> The problem is that RI is implemented by triggers, and there's
> no guarantees about the firing order of multiple triggers.
> So you don't know whether your custom triggers will fire
> before or after the RI actions occur.
Even specifying the after trigger order wouldn't help him
I think. He'd want the deletion of the details rows and their
associated triggers to run before the actual deletion of the
master row. I'd guess that would require the cascade delete
to be being done as a before delete trigger.