TRUNCATE

    Description

    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. This is most useful on large tables.

    You must have the TRUNCATE privilege on the table to truncate table rows.

    name

    The name (optionally schema-qualified) of a table to be truncated.

    Since this key word applies to foreign key references (which are not supported in Greenplum Database) it has no effect.

    RESTRICT

    Since this key word applies to foreign key references (which are not supported in Greenplum Database) it has no effect.

    Notes

    TRUNCATE will not run any user-defined triggers that might exist for the tables.

    TRUNCATE will not truncate any sub-tables of a partitioned table. If you specify a sub-table of a partitioned table, will not remove rows from the sub-table and its child tables.

    Empty the table films:

    1. TRUNCATE films;

    Compatibility

    There is no command in the SQL standard.

    DELETE,