OnCallReady

Commands

dropdb - remove a PostgreSQL database

dropdb [OPTION]... DBNAME

Options you will use

--if-exists
don't report error if database doesn't exist.
-f, --force
try to terminate other connections before dropping.
-i, --interactive
prompt before deleting anything.
-h, --host=HOSTNAME
database server host or socket directory (default: the Unix socket in /var/run/postgresql). A value starting with / is a socket directory; anything else is TCP.
-p, --port=PORT
database server port (default 5432).
-U, --username=USERNAME
database user name (default: your OS user name).
-w, --no-password
never prompt for a password (fail instead: what scripts want).
-W, --password
force a password prompt (normally automatic).

Examples

$ sudo -u postgres dropdb --if-exists scratch

remove a scratch database

Try dropdb in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.