Removes a database.
dropdb [<connection-option> ...] [-e] [-i] <dbname>
dropdb -? | --help
dropdb -V | --version
dropdb
destroys an existing database. The user who runs this command must be a superuser or the owner of the database being dropped.
dropdb
is a wrapper around the SQL command DROP DATABASE
. See the Greenplum Database Reference Guide for information about DROP DATABASE.
dropdb
generates and sends to the server.
dropdb
version and exit.
dropdb
command line arguments, and exit.
Connection Options
PGHOST
or defaults to localhost.
PGPORT
or defaults to 5432.
PGUSER
or defaults to the current system role name.
.pgpass
file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.
postgres
database will be used; if that does not exist (or if it is the name of the database being dropped),
template1
will be used.
To destroy the database named demo
using default connection parameters:
dropdb demo
To destroy the database named demo
using connection options, with verification, and a peek at the underlying command:
dropdb -p 54321 -h coordinatorhost -i -e demo
Database "demo" will be permanently deleted.
Are you sure? (y/n) y
DROP DATABASE "demo"
DROP DATABASE