dropdb [ options ] dbname
This parameter takes the hostname of the machine running postmaster (the backend process). If you are dropping a database on a local backend process and need to specify the directory for the Unix domain socket, prefix host with a slash.
If connecting to a remote backend process, this parameter needs to provide the TCP/IP port number that the backend is listening on. Otherwise, use it to specify the local socket file extension.
This parameter takes the username you wish to connect as.
Use this parameter to force a password request.
Use this parameter to have all queries generated by dropdb echoed to the screen when they are sent to the backend process.
Use this parameter to run in quiet mode; this causes the program to exit without displaying any results.
Use this parameter to have all actions interactively verified before completing.
This parameter takes the name of the existing database you wish to remove.
This message is displayed if the database is successfully removed.
This error message is displayed if the program is unable to remove the database. Most of the time this will be due to an issue with the backend process; in this case (if the error is encountered at the backend) the backend error message will be displayed.
The dropdb program performs the same action as SQL's DROP DATABASE command: it removes a database from the system; however, you can call dropdb from the command line, instead of having to open psql. To drop a database with this command (as with DROP DATABASE ), you must be the owner or a database superuser.
The following example demonstrates how to destroy the test database.
$ dropdb test DROP DATABASE