Skip to content

DROP DATABASE

Drop an existing physical database.

DROP DATABASE [ IF EXISTS ] name

For example:

premdb=# drop database shakespeare;
DROP DATABASE

If you use the IF EXISTS option, no error message is returned if the named database does not exist. For example:

premdb=# drop database shakespeare;
ERROR:  database "shakespeare" does not exist
premdb=# drop database if exists shakespeare;
DROP DATABASE

You cannot drop a database that is in HOT_STANDBY mode.

Parent topic:SQL Commands