DROP TABLE

Function

DROP TABLE deletes a specified table.

Precautions

  • Be cautious when using DROP OBJECT (e.g., DATABASE, USER/ROLE, SCHEMA, TABLE, VIEW) as it may cause data loss, especially with CASCADE deletions. Always back up data before proceeding.
  • For more information about development and design specifications, see "GaussDB(DWS) Development and Design Proposal" in the Data Warehouse Service (DWS) Developer Guide.

Syntax

1
2
DROP TABLE [ IF EXISTS ] 
    { [schema.]table_name } [, ...] [ CASCADE | RESTRICT ] ;

Parameter Description

Example

Delete the warehouse_t1 table:

1
DROP TABLE tpcds.warehouse_t1;

Helpful Links

ALTER TABLE, 12.101-RENAME TABLE, and CREATE TABLE