Contents / Previous / Next


Destroying DBs: DROP

DBs are destroyed with: DROP DATABASE name Only the owner of the DB (i.e., the user that created it), or a superuser, can drop a DB.
Dropping a DB removes all objects that were contained within the DB, this cannot be undone.

You cannot execute the DROP DATABASE command while connected to the victim DB. You must be connected to another DB, e.g., the template1 DB.

Alternatively there is also a shell program to drop DBs:

dropdb dbname