v.20.12Improvement

Informative error message for ATTACH/DETACH TABLE in ClickHouse

Throw an informative error message when doing ATTACH/DETACH TABLE <DICTIONARY>. Before this PR, detach table <dict> works but leads to an ill-formed in-memory metadata. #16885 (Amos Bird).
Throw informative errors on ATTACH/DETACH TABLE for dictionaries.

Why it matters

Prevent ill-formed in-memory metadata by disallowing ATTACH/DETACH operations on dictionary objects, improving error clarity and system stability.

How to use it

When attempting to attach or detach dictionary objects using ATTACH TABLE <dictionary> or DETACH TABLE <dictionary>, ClickHouse will now return a clear and informative error message instead of allowing the operation. Users should avoid these commands for dictionaries to prevent metadata corruption.