1 .\\" auto-generated by docbook2man-spec $Revision: 1.1 $
2 .TH "VACUUMDB" "1" "2003-11-02" "Application" "PostgreSQL Client Applications"
4 vacuumdb \- garbage-collect and analyze a PostgreSQL database
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
13 \fBvacuumdb\fR is a utility for cleaning a
15 \fBvacuumdb\fR will also generate internal statistics
16 used by the PostgreSQL query optimizer.
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.
24 \fBvacuumdb\fR accepts the following command-line arguments:
31 \fB[-d] \fIdbname\fB\fR
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
44 Echo the commands that \fBvacuumdb\fR generates
45 and sends to the server.
50 Perform ``full'' vacuuming.
55 Do not display a response.
57 \fB-t \fItable\fB [ (\fIcolumn\fB [,...]) ]\fR
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.
66 If you specify columns, you probably have to escape the parentheses
67 from the shell. (See examples below.)
74 Print detailed information during processing.
79 Calculate statistics for use by the optimizer.
82 \fBvacuumdb\fR also accepts
83 the following command-line arguments for connection parameters:
87 \fB--host \fIhost\fB\fR
88 Specifies the host name of the machine on which the
90 is running. If the value begins with a slash, it is used
91 as the directory for the Unix domain socket.
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.
100 \fB-U \fIusername\fB\fR
102 \fB--username \fIusername\fB\fR
103 User name to connect as
108 Force password prompt.
119 Default connection parameters
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
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.
136 To clean the database test:
139 $ \fBvacuumdb test\fR
143 To clean and analyze for the optimizer a database named
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
161 VACUUM [\fBvacuum\fR(7)]