commands.sh

dropdb

all

Remove a PostgreSQL database. A simple wrapper around the SQL command `DROP DATABASE`.

More info →

Options (7)

-i, --interactiveboolean

Request a verification prompt before any destructive actions

Example: dropdb {{[-i|--interactive]}} {{database_name}}
-U, --usernameboolean

Connect with a specific username and destroy a database

Example: dropdb {{[-U|--username]}} {{username}} {{database_name}}
-W, --passwordboolean

Force a password prompt before connecting to the database

Example: dropdb {{[-W|--password]}} {{database_name}}
-w, --no-passwordboolean

Suppress a password prompt before connecting to the database

Example: dropdb {{[-w|--no-password]}} {{database_name}}
-h, --hostboolean

Specify the server host name

Example: dropdb {{[-h|--host]}} {{host}} {{database_name}}
-p, --portboolean

Specify the server port

Example: dropdb {{[-p|--port]}} {{port}} {{database_name}}
-f, --forceboolean

Attempt to terminate existing connections before destroying the database

Example: dropdb {{[-f|--force]}} {{database_name}}

Examples (8)

Destroy a database

dropdb database_name

Request a verification prompt before any destructive actions

dropdb [-i|--interactive] database_name

Connect with a specific username and destroy a database

dropdb [-U|--username] username database_name

Force a password prompt before connecting to the database

dropdb [-W|--password] database_name

Suppress a password prompt before connecting to the database

dropdb [-w|--no-password] database_name

Specify the server host name

dropdb [-h|--host] host database_name

Specify the server port

dropdb [-p|--port] port database_name

Attempt to terminate existing connections before destroying the database

dropdb [-f|--force] database_name
made by @shridhargupta | data from tldr-pages