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:
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 asDELETE:
Truncation preserves the schema, indexes, tags, branches, and earlier table
versions. To recover rows, restore a version retained from before truncation: