TRUNCATE
Empties a table of all rows.
Synopsis
TRUNCATE [TABLE] <name> [, ...] [CASCADE | RESTRICT]
Description
TRUNCATE
quickly removes all rows from a table or set of tables.This is most useful on large tables.
Parameters
Notes
Only the owner of a table may TRUNCATE
it. TRUNCATE
will not perform the following:
Run any user-defined
ON DELETE
triggers that might exist for the tables.Note: HAWQ does not support user-defined triggers.
Truncate any tables that inherit from the named table. Only the named table is truncated, not its child tables.
Examples
Empty the table films
:
TRUNCATE films;
Compatibility
There is no TRUNCATE
command in the SQL standard.