1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998)
originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>dropdb</TITLE>
<META NAME="description" CONTENT="dropdb">
<META NAME="keywords" CONTENT="15467">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="15467.css">
<LINK REL="next" HREF="node247.html">
<LINK REL="previous" HREF="node245.html">
<LINK REL="up" HREF="node200.html">
<LINK REL="next" HREF="node247.html">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#A00000" ALINK="#0000FF">
<!--Navigation Panel-->
<A NAME="tex2html6133"
HREF="node247.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next_motif.gif"></A>
<A NAME="tex2html6129"
HREF="node200.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up_motif.gif"></A>
<A NAME="tex2html6123"
HREF="node245.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="previous_motif.gif"></A>
<A NAME="tex2html6131"
HREF="node3.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents_motif.gif"></A>
<A NAME="tex2html6132"
HREF="node288.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html6134"
HREF="node247.html">droplang</A>
<B> Up:</B> <A NAME="tex2html6130"
HREF="node200.html">Reference Manual</A>
<B> Previous:</B> <A NAME="tex2html6124"
HREF="node245.html">DROP VIEW</A>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><strong>Subsections</strong></A>
<UL>
<LI><A NAME="tex2html6135"
HREF="node246.html#SECTION0032461000000000000000">Name</A>
<UL>
<LI><A NAME="tex2html6136"
HREF="node246.html#SECTION0032461100000000000000">Inputs </A>
<LI><A NAME="tex2html6137"
HREF="node246.html#SECTION0032461200000000000000">Outputs </A>
</UL>
<LI><A NAME="tex2html6138"
HREF="node246.html#SECTION0032462000000000000000">Description </A>
<LI><A NAME="tex2html6139"
HREF="node246.html#SECTION0032463000000000000000">Usage </A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION0032460000000000000000"> </A><A NAME="16794"> </A><A NAME="16795"> </A>
<BR>
dropdb
</H1>
<P>
<H2><A NAME="SECTION0032461000000000000000">
Name</A>
</H2>
<P>
dropdb -- Remove an existing Postgres database
<P>
dropdb [ <EM>options</EM> ] <EM>dbname</EM>
<P>
<H3><A NAME="SECTION0032461100000000000000">
Inputs </A>
</H3>
<P>
<DL>
<DT><STRONG>-h, -host <EM>host</EM></STRONG>
<DD>Specifies the hostname of the machine on
which the postmaster is running.
<DT><STRONG>-p, -port <EM>port</EM></STRONG>
<DD>Specifies the Internet TCP/IP port or local
Unix domain socket file extension on which the postmaster is listening
for connections.
<DT><STRONG>-U, -username <EM>username</EM></STRONG>
<DD>Username to connect as.
<DT><STRONG>-W, -password</STRONG>
<DD>Force password prompt.
<DT><STRONG>-e, -echo</STRONG>
<DD>Echo the queries that dropdb generates and sends to the
backend.
<DT><STRONG>-q, -quiet</STRONG>
<DD>Do not display a response.
<DT><STRONG>-i, -interactive</STRONG>
<DD>Issues a verification prompt before doing anything
destructive.
<DT><STRONG><EM>dbname</EM> </STRONG>
<DD>Specifies the name of the database to be removed.
The database must be one of the existing Postgres databases in this
installation.
</DL>The options -h, -p, -U, -W, and -e are passed on literally to <EM>psql</EM>.
<P>
<H3><A NAME="SECTION0032461200000000000000">
Outputs </A>
</H3>
<P>
<DL>
<DT><STRONG>DROP DATABASE</STRONG>
<DD>The database was successfully removed.
<DT><STRONG>dropdb: Database removal failed.</STRONG>
<DD>Something didn't work out.
</DL>If there is an error condition, the backend error message will be
displayed. See <EM>DROP DATABASE</EM> and <EM>psql</EM> for possibilities.
<P>
<H2><A NAME="SECTION0032462000000000000000">
Description </A>
</H2>
<P>
dropdb destroys an existing Postgres database. The user who executes
this command must be a database superuser or the owner of the database.
<P>
dropdb is a shell script wrapper around the SQL command <EM>DROP
DATABASE</EM> via the Postgres interactive terminal <EM>psql</EM>. Thus,
there is nothing special about dropping databases via this or other
methods. This means that the <EM>psql</EM> 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 <EM>psql</EM>
and the libpq front-end library do apply.
<P>
<H2><A NAME="SECTION0032463000000000000000">
Usage </A>
</H2>
<P>
To destroy the database demo on the default database server:
<P>
<TT>
<BR>
<BR> $ dropdb demo
<BR> DROP DATABASE
</TT>
<BR>
<BR>
To destroy the database demo using the postmaster on host eden, port
5000, with verification and a peek at the underlying query:
<P>
<TT>
<BR>
<BR> $ <B>dropdb -p 5000 -h eden -i -e demo</B>
<BR> Database "demo" will be permanently deleted. Are you sure? (y/n) <B>y</B>
<BR> DROP DATABASE "demo" DROP DATABASE <A NAME="16829"> </A><A NAME="16830"> </A>
</TT>
<BR>
<BR>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html6133"
HREF="node247.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next_motif.gif"></A>
<A NAME="tex2html6129"
HREF="node200.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up_motif.gif"></A>
<A NAME="tex2html6123"
HREF="node245.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="previous_motif.gif"></A>
<A NAME="tex2html6131"
HREF="node3.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents_motif.gif"></A>
<A NAME="tex2html6132"
HREF="node288.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index_motif.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html6134"
HREF="node247.html">droplang</A>
<B> Up:</B> <A NAME="tex2html6130"
HREF="node200.html">Reference Manual</A>
<B> Previous:</B> <A NAME="tex2html6124"
HREF="node245.html">DROP VIEW</A>
<!--End of Navigation Panel-->
<ADDRESS>
<I>Bruce Momjian</I>
<BR><I>2002-01-08</I>
</ADDRESS>
</BODY>
</HTML>
|