# man > dropdb(1)

---
type: CommandReference
command: dropdb
mode: man
section: 1
source: man-pages
---

## Quick Reference

- `dropdb {{database_name}}` — Destroy a database.
- `dropdb -i {{database_name}}` — Request a verification prompt before any destructive actions.
- `dropdb -U {{username}} {{database_name}}` — Connect with a specific username and destroy a database.
- `dropdb -W {{database_name}}` — Force a password prompt before connecting.
- `dropdb -w {{database_name}}` — Suppress a password prompt before connecting.
- `dropdb -h {{host}} {{database_name}}` — Specify the server host name.
- `dropdb -p {{port}} {{database_name}}` — Specify the server port.
- `dropdb -f {{database_name}}` — Attempt to terminate existing connections before destroying the database.

## Name

dropdb - remove a PostgreSQL database

## Synopsis

`dropdb` [_connection-option_...] [_option_...] _dbname_

## Options

- `dbname` — Specifies the name of the database to be removed.
- `-e, --echo` — Echo the commands that dropdb generates and sends to the server.
- `-f, --force` — Attempt to terminate all existing connections to the target database before dropping it.
- `-i, --interactive` — Issues a verification prompt before doing anything destructive.
- `-V, --version` — Print the dropdb version and exit.
- `--if-exists` — Do not throw an error if the database does not exist. A notice is issued instead.
- `-?, --help` — Show help about dropdb command line arguments and exit.
- `-h, --host=host` — Specifies the host name of the machine on which the server is running.
- `-p, --port=port` — Specifies the TCP port or local Unix domain socket file extension.
- `-U, --username=username` — User name to connect as.
- `-w, --no-password` — Never issue a password prompt. Useful in batch jobs.
- `-W, --password` — Force dropdb to prompt for a password before connecting.
- `--maintenance-db=dbname` — Specifies the database to connect to in order to drop the target database. Defaults to `postgres` or `template1`.

## Examples

To destroy the database `demo` on the default server:

shell
$ dropdb demo
To destroy `demo` on host `eden`, port 5000, with verification and echo:

shell
$ dropdb -p 5000 -h eden -i -e demo
Database "demo" will be permanently deleted.
Are you sure? (y/n) y
DROP DATABASE demo;
## See Also

- [createdb(1)](https://www.chedong.com/phpMan.php/man/createdb/1/markdown)
- [DROP DATABASE](https://www.chedong.com/phpMan.php/man/DATABASE/7/markdown)