Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

You cannot truncate the parent table of an enabled foreign key
constraint. You must disable the constraint before truncating the
table. An exception is that you can truncate the table if the
integrity constraint is self-referential.

This is presumably because truncate is DDL and doesn't do any checks on data in the target table, even to see if it has any rows. It would have to do that DML, and look for any matching rows in all child tables (or at least check there are no rows), etc, which would change the nature of the command and potentially impact performance. And it would have to consider uncommitted transactions against the child tables, which would have expected an error on insert rather than commit if the constraint wasn't defferred.

The only way to do this is to disable or drop the constraint, as @ik_zelf shows.