Skip to content

DROP TABLE

DROP TABLE removes an existing table.

DROP TABLE [IF EXISTS] table_name

The command removes the relation, its rows and table-local index metadata. IF EXISTS suppresses the missing-object error only.

table_name is an unqualified table name in the current catalog namespace.

Success returns a command result with no rows. IF EXISTS also succeeds when no matching table exists.

DROP TABLE is transactional. Until commit, other sessions retain their valid committed view; ROLLBACK preserves the table.

Without IF EXISTS, a missing table is an error. Dependencies and referential constraints can prevent removal. The command does not delete another database or unrelated files.

The effective Principal must own the table; the session also needs CONNECT.

CREATE TABLE ref_drop_table (id INTEGER PRIMARY KEY);
DROP TABLE ref_drop_table;
SHOW TABLES;

See Defining a Schema, CREATE TABLE and ROLLBACK.