v.21.6Improvement

Forbid Dropping Columns Referenced by Materialized Views

Forbid to drop a column if it's referenced by materialized view. Closes #21164. #21303 (flynn).
ClickHouse now prevents dropping a column if it is referenced by a materialized view.

Why it matters

This feature ensures data consistency and avoids accidental breakage by forbidding the removal of columns that are used by materialized views. It protects users from errors that would occur if a materialized view relies on a column that no longer exists.

How to use it

Users do not need to enable anything explicitly. When attempting to drop a column, ClickHouse will automatically check for references in materialized views and reject the operation if dependencies are found.