.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "DROPDB" "1" "2002-11-22" "Application" "PostgreSQL Client Applications" .SH NAME dropdb \- remove a PostgreSQL database .SH SYNOPSIS .sp \fBdropdb\fR\fR [ \fR\fB\fIoptions\fB\fR...\fB \fR\fR]\fR \fB\fIdbname\fB\fR .SH "DESCRIPTION" .PP \fBdropdb\fR destroys an existing PostgreSQL database. The user who executes this command must be a database superuser or the owner of the database. .PP \fBdropdb\fR is a shell script wrapper around the SQL command DROP DATABASE [\fBdrop_database\fR(7)] via the PostgreSQL interactive terminal \fBpsql\fR(1). Thus, there is nothing special about dropping databases via this or other methods. This means that the \fBpsql\fR must be found by the script and that a database server is running at the targeted host. Also, any default settings and environment variables available to \fBpsql\fR and the \fBlibpq\fR front-end library do apply. .SH "OPTIONS" .PP \fBdropdb\fR accepts the following command-line arguments: .TP \fB\fIdbname\fB\fR Specifies the name of the database to be removed. The database must be one of the existing PostgreSQL databases in this installation. .TP \fB-e\fR .TP \fB--echo\fR Echo the queries that \fBdropdb\fR generates and sends to the server. .TP \fB-i\fR .TP \fB--interactive\fR Issues a verification prompt before doing anything destructive. .TP \fB-q\fR .TP \fB--quiet\fR Do not display a response. .PP .PP \fBcreatedb\fR also accepts the following command-line arguments for connection parameters: .TP \fB-h \fIhost\fB\fR .TP \fB--host \fIhost\fB\fR Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. .TP \fB-p \fIport\fB\fR .TP \fB--port \fIport\fB\fR Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. .TP \fB-U \fIusername\fB\fR .TP \fB--username \fIusername\fB\fR User name to connect as .TP \fB-W\fR .TP \fB--password\fR Force password prompt. .PP .SH "DIAGNOSTICS" .TP \fBDROP DATABASE\fR The database was successfully removed. .TP \fBdropdb: Database removal failed.\fR Something didn't work out. .PP If there is an error condition, the backend error message will be displayed. See DROP DATABASE [\fBdrop_database\fR(7)] and \fBpsql\fR(1) for possibilities. .PP .SH "ENVIRONMENT" .TP \fBPGHOST\fR .TP \fBPGPORT\fR .TP \fBPGUSER\fR Default connection parameters .SH "EXAMPLES" .PP To destroy the database demo on the default database server: .sp .nf $ \fBdropdb demo\fR DROP DATABASE .sp .fi .PP To destroy the database demo using the server on host eden, port 5000, with verification and a peek at the underlying query: .sp .nf $ \fBdropdb -p 5000 -h eden -i -e demo\fR Database "demo" will be permanently deleted. Are you sure? (y/n) \fBy\fR DROP DATABASE "demo" DROP DATABASE .sp .fi .SH "SEE ALSO" \fBcreatedb\fR(1), DROP DATABASE [\fBdrop_database\fR(7)]