2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.2 1999/12/07 22:41:41 momjian Exp $
6 <refentry id="APP-DROPDB">
8 <refentrytitle id="APP-DROPDB-TITLE">
9 <application>dropdb</application>
11 <refmiscinfo>Application</refmiscinfo>
15 <application>dropdb</application>
18 Remove an existing <productname>PostgreSQL</productname> database
23 <date>1999-11-07</date>
26 dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable class="parameter">dbname</replaceable>
29 <refsect2 id="R2-APP-DROPDB-1">
31 <date>1999-11-07</date>
40 <term>-h, --host <replaceable class="parameter">host</replaceable></term>
43 Specifies the hostname of the machine on which the
44 <application>postmaster</application>
51 <term>-p, --port <replaceable class="parameter">port</replaceable></term>
54 Specifies the Internet TCP/IP port or local Unix domain socket file
55 extension on which the <application>postmaster</application>
56 is listening for connections.
62 <term>-U, --username <replaceable class="parameter">username</replaceable></term>
65 Username to connect as.
71 <term>-W, --password</term>
74 Force password prompt.
80 <term>-e, --echo</term>
83 Echo the queries that <application>dropdb</application> generates
84 and sends to the backend.
90 <term>-q, --quiet</term>
93 Do not display a response.
99 <term>-i, --interactive</term>
102 Issues a verification prompt before doing anything destructive.
108 <term><replaceable class="parameter">dbname</replaceable></term>
111 Specifies the name of the database to be removed. The database
112 must be one of the existing <productname>PostgreSQL</productname> databases
113 in this installation.
119 The options <literal>-h</literal>, <literal>-p</literal>, <literal>-U</literal>,
120 <literal>-W</literal>, and <literal>-e</literal> are passed on literally to
121 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">.
126 <refsect2 id="R2-APP-DROPDB-2">
128 <date>1998-10-02</date>
137 <term><computeroutput>DROP DATABASE</computeroutput></term>
139 <para>The database was successfully removed.</para>
144 <term><computeroutput>dropdb: Database removal failed.</computeroutput></term>
146 <para>Something didn't work out.</para>
151 If there is an error condition, the backend error message will be displayed.
152 See <xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title">
153 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for possibilities.
159 <refsect1 id="R1-APP-DROPDB-1">
161 <date>1998-10-02</date>
167 <application>dropdb</application> destroys an existing
168 <productname>PostgreSQL</productname> database.
169 The user who executes this command must be a database
170 superuser or the owner of the database.
174 <application>dropdb</application> is a shell script wrapper around the
175 <acronym>SQL</acronym> command
176 <xref linkend="SQL-DROPDATABASE" endterm="SQL-DROPDATABASE-title"> via
177 the <productname>PostgreSQL</productname> interactive terminal
178 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. Thus, there is nothing
179 special about dropping databases via this or other methods. This means
180 that the <application>psql</application> must be found by the script and that
181 a database server is running at the targeted host. Also, any default
182 settings and environment variables available to <application>psql</application>
183 and the <application>libpq</application> front-end library do apply.
187 <refsect1 id="R1-APP-DROPDB-2">
189 <date>1999-11-07</date>
195 To destroy the database <literal>demo</literal>
196 on the default database server:
198 $ <userinput>dropdb demo</userinput>
203 To destroy the database <literal>demo</literal>
204 using the postmaster on host eden, port 5000, with verification
205 and a peek at the underlying query:
207 $ <userinput>dropdb -p 5000 -h eden -i -e demo</userinput>
208 Database "demo" will be permanently deleted.
209 Are you sure? (y/n) <userinput>y</userinput>
217 <!-- Keep this comment at the end of the file
222 sgml-minimize-attributes:nil
223 sgml-always-quote-attributes:t
226 sgml-parent-document:nil
227 sgml-default-dtd-file:"../reference.ced"
228 sgml-exposed-tags:nil
229 sgml-local-catalogs:"/usr/lib/sgml/catalog"
230 sgml-local-ecat-files:nil