DROP DATABASE

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

Synopsis

The DROP DATABASE statement removes a database and all its database objects (such as tables or types) from the system.

Syntax

Diagram

DROP DATABASE - 图1

Grammar

  1. drop_database ::= DROP DATABASE [ IF EXISTS ] database_name;

Where

  • database_name is an identifier.

Semantics

  • An error is raised if the specified database_name does not exist unless IF EXISTS option is present.
  • Currently, an error is raised if the specified database is non-empty (contains tables or types). This restriction will be removed.

See Also

CREATE DATABASEOther PostgreSQL Statements