With a ON DELETE RESTRICT
restriction, I understand that you can't delete a row in the parent table if a reference exist in the child table, but is it expected behavior that even if the child table is actually empty you still cannot TRUNCATE
the parent table?
TRUNCATE
will fail even whenON DELETE RESTRICT
is not specified. This operation uses fast records deleting technique which does not include FK checks.TRUNCATE
is a drastic action that is outside of the 'norm'. Please explain why you need to Truncate; perhaps there is another action that would achieve the goals and keep FKs.