dropdb

A core utility for dropping a database

dropdb is a core utility for dropping (deleting) a database and is essentially a wrapper around the DROP DATABASE SQL command.

dropdb was added in PostgreSQL 7.0.

Source code

The dropdb source code is located at src/bin/scripts/dropdb.c.

Change history

Examples

$ psql -c 'SELECT datname FROM pg_database'
  datname  
-----------
 postgres
 template1
 template0
 foo
(4 rows)

$ dropdb foo
$ psql -c 'SELECT datname FROM pg_database'
  datname  
-----------
 postgres
 template1
 template0
(3 rows)
  • PostgreSQL documentation: dropdb

Categories

Core utility

See also

DROP DATABASE, createdb