Skip to main content
Enterprise only
TRUNCATE removes every row from one native base table and commits one new table version, including when the table is already empty. The TABLE keyword is optional:
Unqualified names use the session database and namespace. Qualified names follow the usual SQL identifier rules.

Permissions and supported tables

TRUNCATE requires the same permissions as DELETE: DELETE on the table and USAGE on its database and namespace. It does not require SELECT or table ownership. Views, materialized views, and system tables cannot be truncated. WAL-backed tables are also refused: as with DELETE without a WHERE clause, truncation cannot atomically remove rows from both the base table and the WAL tier. Tables with Function columns follow the same behavior as an unfiltered DELETE. Their column declarations and Function bindings remain. Materialized views reading the table retain their stored rows until refreshed; their next refresh observes the empty source. RESTART IDENTITY, CASCADE, multiple table targets, and a WHERE clause are unsupported and rejected before execution.

Result and recovery

The result has the same columns as DELETE: Truncation preserves the schema, indexes, tags, branches, and earlier table versions. To recover rows, restore a version retained from before truncation:
Restore requires table ownership. The old version and its data must still be retained; versions removed by cleanup cannot be restored.