v.23.2Improvement
Add check_referential_table_dependencies Setting for DROP TABLE Referential Checks
Add settingcheck_referential_table_dependenciesto check referential dependencies onDROP TABLE. This PR solves #38326. #45936 (Vitaly Baranov).
Why it matters
This feature prevents accidental dropping of tables that other tables depend on via referential integrity constraints, thereby avoiding data inconsistency and ensuring database integrity.How to use it
Users can enable the feature by settingcheck_referential_table_dependencies = 1 before executing a DROP TABLE statement. This causes ClickHouse to verify that no referential dependencies exist before allowing the table to be dropped.