DROP TABLE

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Synopsis

The DROP TABLE statement removes a table and all of its data from the database.

Syntax

Diagram

DROP TABLE - 图1

Grammar

  1. drop_table ::= DROP TABLE [ IF EXISTS ] table_name;

Where

  • table_name is an identifier.

Semantics

  • An error is raised if the specified table_name does not exist unless IF EXISTS option is present.
  • Associated objects to table_name such as prepared statements will be eventually invalidated after the drop statement is completed.

See Also

CREATE TABLEDELETEINSERTSELECTUPDATEOther PostgreSQL Statements