DROP DATABASE name
This message is displayed if the database is dropped correctly.
This error is displayed if you attempt to drop a database with a user account that does not have the proper permissions. You must have the CREATEDB privilege to drop databases. See CREATE USER.
This error is displayed if you attempt to drop the template1 database. This database cannot be dropped; it is a system database.
This error message is displayed if you attempt to drop a database you currently connected to. If this happens, try connecting to the template1 database and issuing the command to drop the database you were previously working on.
This error is displayed if the database you are requesting to delete does not exist.
This error is displayed when you attempt to delete a database that you are not the owner of.
This error is displayed if you attempt to call the command from within a transaction block. You must finish any current transactions before the database will let you use this command.
This error message is displayed if a dropped database's specified data directory could not be removed. You will have to delete the data directory manually in order to complete the drop.
Use the DROP DATABASE command to remove a database from the system. All data and catalog entries for the database are deleted when you drop a database. Attempting to use this command on a database you are currently connected to will result in an error; for this reason it may be more convenient to use the dropdb shell script.
Warning | |
---|---|
Only the owner of a database may drop it with this command. |