Seth Woolley's Man Viewer

Manual for truncate - man 7 truncate

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

TRUNCATE(7)                      SQL Commands                      TRUNCATE(7)



NAME
       TRUNCATE - empty a table


SYNOPSIS
       TRUNCATE [ TABLE ] name


DESCRIPTION
       TRUNCATE  quickly removes all rows from a table. It has the same effect
       as an unqualified DELETE but since it does not actually scan the  table
       it is faster. This is most useful on large tables.

PARAMETERS
       name   The  name (optionally schema-qualified) of the table to be trun-
              cated.

NOTES
       TRUNCATE cannot be used if(3,n) there are foreign-key references to the  ta-
       ble  from  other  tables. Checking validity in(1,8) such cases would require
       table scans, and the whole point is not to do one.

       TRUNCATE will not run any user-defined ON DELETE  triggers  that  might
       exist for the table.

EXAMPLES
       Truncate the table bigtable:

       TRUNCATE TABLE bigtable;


COMPATIBILITY
       There is no TRUNCATE command in(1,8) the SQL standard.



SQL - Language Statements         2003-11-02                       TRUNCATE(7)

References for this manual (incoming links)