]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/dropdb.sgml
Okay, that should put us back in sync. These two patches (src & doc) are
[postgresql] / doc / src / sgml / ref / dropdb.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/dropdb.sgml,v 1.2 1999/12/07 22:41:41 momjian Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-DROPDB">
7  <refmeta>
8   <refentrytitle id="APP-DROPDB-TITLE">
9    <application>dropdb</application>
10   </refentrytitle>
11   <refmiscinfo>Application</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname>
15    <application>dropdb</application>
16   </refname>
17   <refpurpose>
18    Remove an existing <productname>PostgreSQL</productname> database
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-11-07</date>
24   </refsynopsisdivinfo>
25   <synopsis>
26 dropdb [ <replaceable class="parameter">options</replaceable> ] <replaceable class="parameter">dbname</replaceable>
27   </synopsis>
28
29   <refsect2 id="R2-APP-DROPDB-1">
30    <refsect2info>
31     <date>1999-11-07</date>
32    </refsect2info>
33    <title>
34     Inputs
35    </title>
36    <para>
37
38     <variablelist>
39      <varlistentry>
40       <term>-h, --host <replaceable class="parameter">host</replaceable></term>
41       <listitem>
42        <para>
43         Specifies the hostname of the machine on which the 
44         <application>postmaster</application>
45         is running.
46        </para>
47       </listitem>
48      </varlistentry>
49
50      <varlistentry>
51       <term>-p, --port <replaceable class="parameter">port</replaceable></term>
52       <listitem>
53        <para>
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.
57        </para>
58       </listitem>
59      </varlistentry>
60
61      <varlistentry>
62       <term>-U, --username <replaceable class="parameter">username</replaceable></term>
63       <listitem>
64        <para>
65         Username to connect as.
66        </para>
67       </listitem>
68      </varlistentry>
69
70      <varlistentry>
71       <term>-W, --password</term>
72       <listitem>
73        <para>
74         Force password prompt.
75        </para>
76       </listitem>
77      </varlistentry>
78
79      <varlistentry>
80       <term>-e, --echo</term>
81       <listitem>
82        <para>
83         Echo the queries that <application>dropdb</application> generates
84         and sends to the backend.
85        </para>
86       </listitem>
87      </varlistentry>
88
89      <varlistentry>
90       <term>-q, --quiet</term>
91       <listitem>
92        <para>
93         Do not display a response.
94        </para>
95       </listitem>
96      </varlistentry>
97
98      <varlistentry>
99       <term>-i, --interactive</term>
100       <listitem>
101        <para>
102        Issues a verification prompt before doing anything destructive.
103        </para>
104       </listitem>
105      </varlistentry>
106
107      <varlistentry>
108       <term><replaceable class="parameter">dbname</replaceable></term>
109       <listitem>
110        <para>
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.
114        </para>
115       </listitem>
116      </varlistentry>
117     </variablelist>
118
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">.
122    </para>
123   </refsect2>
124
125
126   <refsect2 id="R2-APP-DROPDB-2">
127    <refsect2info>
128     <date>1998-10-02</date>
129    </refsect2info>
130    <title>
131     Outputs
132    </title>
133    <para>
134
135     <variablelist>
136      <varlistentry>
137       <term><computeroutput>DROP DATABASE</computeroutput></term>
138       <listitem>
139        <para>The database was successfully removed.</para>
140       </listitem>
141      </varlistentry>
142
143      <varlistentry>
144       <term><computeroutput>dropdb: Database removal failed.</computeroutput></term>
145       <listitem>
146        <para>Something didn't work out.</para>
147       </listitem>
148      </varlistentry>
149     </variablelist>
150
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.
154    </para>
155   </refsect2>
156  </refsynopsisdiv>
157
158
159  <refsect1 id="R1-APP-DROPDB-1">
160   <refsect1info>
161    <date>1998-10-02</date>
162   </refsect1info>
163   <title>
164    Description
165   </title>
166   <para>
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.
171   </para>
172
173   <para>
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.
184   </para>
185  </refsect1>
186
187  <refsect1 id="R1-APP-DROPDB-2">
188   <refsect1info>
189    <date>1999-11-07</date>
190   </refsect1info>
191   <title>
192    Usage
193   </title>
194   <para>
195    To destroy the database <literal>demo</literal>
196    on the default database server:
197    <programlisting>
198 $ <userinput>dropdb demo</userinput>
199 DROP DATABASE
200    </programlisting>
201   </para>
202   <para>
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:
206    <programlisting>
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>
210 DROP DATABASE "demo"
211 DROP DATABASE
212    </programlisting>
213   </para>
214  </refsect1>
215 </refentry>
216
217 <!-- Keep this comment at the end of the file
218 Local variables:
219 mode: sgml
220 sgml-omittag:nil
221 sgml-shorttag:t
222 sgml-minimize-attributes:nil
223 sgml-always-quote-attributes:t
224 sgml-indent-step:1
225 sgml-indent-data: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
231 End:
232 -->