Subject | Re: [firebird-support] on delete cascade |
---|---|
Author | Ann W. Harrison |
Post date | 2006-06-02T18:23:23Z |
lobolo2000 wrote:
deletes of the children are a single operation and succeed or
fail together. They can be executed in either order, since the
sequence of the operation should not be visible outside of
the operation.
You have, of course, found an exception .... a trigger on the
delete of the child will notice the order and raise a spurious
error. That's an artifact of the conflict between Firebird's
row by row approach to operational consistency and the SQL
standard which treats each verb as an atomic operation.
Theoretically (I guess) the before delete trigger for the
child should fire before any part of the delete that cascades
to the child, and after delete triggers on the master and the
child should happen after the children are deleted.
But they don't and changing that behavior will be a major
undertaking.
Regards,
Ann
> Shouldn't FB2 delete master records after detail records if an 'onIt doesn't matter. The delete of the master and the cascading
> delete cascade' clause is used (otherwise the referential integrity
> would be violated)?
deletes of the children are a single operation and succeed or
fail together. They can be executed in either order, since the
sequence of the operation should not be visible outside of
the operation.
You have, of course, found an exception .... a trigger on the
delete of the child will notice the order and raise a spurious
error. That's an artifact of the conflict between Firebird's
row by row approach to operational consistency and the SQL
standard which treats each verb as an atomic operation.
Theoretically (I guess) the before delete trigger for the
child should fire before any part of the delete that cascades
to the child, and after delete triggers on the master and the
child should happen after the children are deleted.
But they don't and changing that behavior will be a major
undertaking.
Regards,
Ann