DROP: Deleting a Table
This section describes the basic syntax and usage of the SQL statement for deleting a ClickHouse table.
Basic Syntax
DROP [TEMPORARY] TABLE [IF EXISTS] [database_name.]name [ON CLUSTER cluster] [SYNC]
Example
-- Delete the t1 table. drop table t1 SYNC;
When you delete a replication table, create a path on ZooKeeper to store related data. The default library engine of ClickHouse is the atomic database engine. After a table in the atomic database is deleted, it is not deleted immediately but deleted 480 seconds later. To resolve this issue, when deleting a table, add the SYNC field to the deletion command, for example, drop table t1 SYNC;.
This issue does not occur when a local or distributed table is deleted. The SYNC field is not required in your deletion command, for example, drop table t1;.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot