ClickHouse/docs/en/sql-reference/statements/truncate.md
Antonio Andelic a58653820e Update docs
2023-02-03 18:19:12 +00:00

1.2 KiB

slug sidebar_position sidebar_label
/en/sql-reference/statements/truncate 52 TRUNCATE

TRUNCATE Statement

TRUNCATE TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster]

Removes all data from a table. When the clause IF EXISTS is omitted, the query returns an error if the table does not exist.

The TRUNCATE query is not supported for View, File, URL, Buffer and Null table engines.

You can use the alter_sync setting to set up waiting for actions to be executed on replicas.

You can specify how long (in seconds) to wait for inactive replicas to execute TRUNCATE queries with the replication_wait_for_inactive_replica_timeout setting.

:::note
If the alter_sync is set to 2 and some replicas are not active for more than the time, specified by the replication_wait_for_inactive_replica_timeout setting, then an exception UNFINISHED is thrown. :::