1DROP DATABASE(7)                 SQL Commands                 DROP DATABASE(7)
2
3
4

NAME

6       DROP DATABASE - remove a database
7
8

SYNOPSIS

10       DROP DATABASE [ IF EXISTS ] name
11
12

DESCRIPTION

14       DROP  DATABASE drops a database. It removes the catalog entries for the
15       database and deletes the directory containing the data. It can only  be
16       executed  by the database owner.  Also, it cannot be executed while you
17       or anyone else are connected to the target database. (Connect to  post‐
18       gres or any other database to issue this command.)
19
20       DROP DATABASE cannot be undone. Use it with care!
21

PARAMETERS

23       IF EXISTS
24              Do  not  throw an error if the database does not exist. A notice
25              is issued in this case.
26
27       name   The name of the database to remove.
28

NOTES

30       DROP DATABASE cannot be executed inside a transaction block.
31
32       This command cannot be executed while connected to the target database.
33       Thus, it might be more convenient to use the program dropdb [dropdb(1)]
34       instead, which is a wrapper around this command.
35

COMPATIBILITY

37       There is no DROP DATABASE statement in the SQL standard.
38

SEE ALSO

40       CREATE DATABASE [create_database(7)]
41
42
43
44SQL - Language Statements         2014-02-17                  DROP DATABASE(7)
Impressum