> Returning NULL from a BEFORE DELETE trigger function on a referencing table
> using CASCADE allows you to break RI.
Yup, so don't do that ;-). Actually there are any number of ways to
break an RI constraint with poorly designed triggers. The only way
we could prevent it is to make RI updates not fire triggers, which seems
a cure worse than the disease.
regards, tom lane