Imported upstream version 1.5
[manpages-zh.git] / raw / man1 / vacuumdb.1
blob2693fd05e0424874fc91c8066c4ac6ee91a70680
1 .\\" auto-generated by docbook2man-spec $Revision: 1.1 $
2 .TH "VACUUMDB" "1" "2003-11-02" "Application" "PostgreSQL Client Applications"
3 .SH NAME
4 vacuumdb \- garbage-collect and analyze a PostgreSQL database
6 .SH SYNOPSIS
7 .sp
8 \fBvacuumdb\fR\fR [ \fR\fB\fIconnection-option\fB\fR...\fB \fR\fR]\fR \fR[\fR \fB--full\fR\fR | \fR\fB-f\fR\fR ]\fR \fR[\fR \fB--verbose\fR\fR | \fR\fB-v\fR\fR ]\fR \fR[\fR \fB--analyze\fR\fR | \fR\fB-z\fR\fR ]\fR\fR [ \fR\fB--table | -t \fItable\fB\fR [ \fB( \fIcolumn\fB [,...] ) \fR]\fB \fR\fR]\fR\fR [ \fR\fB\fIdbname\fB \fR\fR]\fR
10 \fBvacuumdb\fR\fR [ \fR\fB\fIconnection-options\fB\fR...\fB \fR\fR]\fR \fR[\fR \fB--all\fR\fR | \fR\fB-a\fR\fR ]\fR \fR[\fR \fB--full\fR\fR | \fR\fB-f\fR\fR ]\fR \fR[\fR \fB--verbose\fR\fR | \fR\fB-v\fR\fR ]\fR \fR[\fR \fB--analyze\fR\fR | \fR\fB-z\fR\fR ]\fR
11 .SH "DESCRIPTION"
12 .PP
13 \fBvacuumdb\fR is a utility for cleaning a
14 PostgreSQL database.
15 \fBvacuumdb\fR will also generate internal statistics
16 used by the PostgreSQL query optimizer.
17 .PP
18 \fBvacuumdb\fR is a wrapper around the SQL
19 command VACUUM [\fBvacuum\fR(7)].
20 There is no effective difference between vacuuming databases via
21 this utility and via other methods for accessing the server.
22 .SH "OPTIONS"
23 .PP
24 \fBvacuumdb\fR accepts the following command-line arguments:
25 .TP
26 \fB-a\fR
27 .TP
28 \fB--all\fR
29 Vacuum all databases.
30 .TP
31 \fB[-d] \fIdbname\fB\fR
32 .TP
33 \fB[--dbname] \fIdbname\fB\fR
34 Specifies the name of the database to be cleaned or analyzed.
35 If this is not specified and \fB-a\fR (or
36 \fB--all\fR) is not used, the database name is read
37 from the environment variable \fBPGDATABASE\fR. If
38 that is not set, the user name specified for the connection is
39 used.
40 .TP
41 \fB-e\fR
42 .TP
43 \fB--echo\fR
44 Echo the commands that \fBvacuumdb\fR generates
45 and sends to the server.
46 .TP
47 \fB-f\fR
48 .TP
49 \fB--full\fR
50 Perform ``full'' vacuuming.
51 .TP
52 \fB-q\fR
53 .TP
54 \fB--quiet\fR
55 Do not display a response.
56 .TP
57 \fB-t \fItable\fB [ (\fIcolumn\fB [,...]) ]\fR
58 .TP
59 \fB--table \fItable\fB [ (\fIcolumn\fB [,...]) ]\fR
60 Clean or analyze \fItable\fR only.
61 Column names may be specified only in conjunction with
62 the \fB--analyze\fR option.
63 .sp
64 .RS
65 .B "Tip:"
66 If you specify columns, you probably have to escape the parentheses
67 from the shell. (See examples below.)
68 .RE
69 .sp
70 .TP
71 \fB-v\fR
72 .TP
73 \fB--verbose\fR
74 Print detailed information during processing.
75 .TP
76 \fB-z\fR
77 .TP
78 \fB--analyze\fR
79 Calculate statistics for use by the optimizer.
80 .PP
81 .PP
82 \fBvacuumdb\fR also accepts 
83 the following command-line arguments for connection parameters:
84 .TP
85 \fB-h \fIhost\fB\fR
86 .TP
87 \fB--host \fIhost\fB\fR
88 Specifies the host name of the machine on which the 
89 server
90 is running. If the value begins with a slash, it is used 
91 as the directory for the Unix domain socket.
92 .TP
93 \fB-p \fIport\fB\fR
94 .TP
95 \fB--port \fIport\fB\fR
96 Specifies the TCP port or local Unix domain socket file 
97 extension on which the server
98 is listening for connections.
99 .TP
100 \fB-U \fIusername\fB\fR
102 \fB--username \fIusername\fB\fR
103 User name to connect as
105 \fB-W\fR
107 \fB--password\fR
108 Force password prompt.
110 .SH "ENVIRONMENT"
112 \fBPGDATABASE\fR
114 \fBPGHOST\fR
116 \fBPGPORT\fR
118 \fBPGUSER\fR
119 Default connection parameters
120 .SH "DIAGNOSTICS"
122 In case of difficulty, see VACUUM [\fBvacuum\fR(7)] and \fBpsql\fR(1) for
123 discussions of potential problems and error messages.
124 The database server must be running at the
125 targeted host. Also, any default connection settings and environment
126 variables used by the \fBlibpq\fR front-end
127 library will apply.
128 .SH "NOTES"
130 \fBvacuumdb\fR might need to connect several
131 times to the PostgreSQL server, asking
132 for a password each time. It is convenient to have a
133 \fI$HOME/.pgpass\fR file in such cases.
134 .SH "EXAMPLES"
136 To clean the database test:
139 $ \fBvacuumdb test\fR
143 To clean and analyze for the optimizer a database named
144 bigdb:
147 $ \fBvacuumdb --analyze bigdb\fR
151 To clean a single table
152 foo in a database named
153 xyzzy, and analyze a single column
154 bar of the table for the optimizer:
157 $ \fBvacuumdb --analyze --verbose --table 'foo(bar)' xyzzy\fR
160 .SH "SEE ALSO"
161 VACUUM [\fBvacuum\fR(7)]