TRUNCATE
Empties a table or set of tables of all rows.
信息
Apache Cloudberry does not enforce referential integrity syntax (foreign key constraints). TRUNCATE
truncates a table that is referenced in a foreign key constraint even if the CASCADE
option is omitted.
Synopsis
TRUNCATE [TABLE] [ONLY] <name> [ * ] [, ...]
[ RESTART IDENTITY | CONTINUE IDENTITY ] [CASCADE | RESTRICT]
Description
TRUNCATE
quickly removes all rows from a table or set of tables. It has the same effect as an unqualified DELETE
on each table, but since it does not actually scan the tables it is faster. Furthermore, it reclaims disk space immediately, rather than requiring a subsequent VACUUM
operation. This is most useful on large tables.
You must have the TRUNCATE
privilege on the table to truncate it.