.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "VACUUMDB" "1" "2002-11-22" "Application" "PostgreSQL Client Applications" .SH NAME vacuumdb \- garbage-collect and analyze a PostgreSQL database .SH SYNOPSIS .sp \fBvacuumdb\fR\fR [ \fR\fB\fIconnection-options\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 \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 .SH "DESCRIPTION" .PP \fBvacuumdb\fR is a utility for cleaning a PostgreSQL database. \fBvacuumdb\fR will also generate internal statistics used by the PostgreSQL query optimizer. .PP \fBvacuumdb\fR is a shell script wrapper around the backend command VACUUM [\fBvacuum\fR(7)] via the PostgreSQL interactive terminal \fBpsql\fR(1). There is no effective difference between vacuuming databases via this or other methods. \fBpsql\fR must be found by the script and a database server must be running at the targeted host. Also, any default settings and environment variables available to \fBpsql\fR and the \fBlibpq\fR front-end library do apply. .PP \fBvacuumdb\fR might need to connect several times to the PostgreSQL server, asking for a password each time. It is convenient to have a \fI$HOME/.pgpass\fR file in such cases. .SH "OPTIONS" .PP \fBvacuumdb\fR accepts the following command-line arguments: .TP \fB[-d] \fIdbname\fB\fR .TP \fB[--dbname] \fIdbname\fB\fR Specifies the name of the database to be cleaned or analyzed. If this is not specified and \fB-a\fR (or \fB--all\fR) is not used, the database name is read from the environment variable \fBPGDATABASE\fR. If that is not set, the user name specified for the connection is used. .TP \fB-a\fR .TP \fB--all\fR Vacuum all databases. .TP \fB-e\fR .TP \fB--echo\fR Echo the commands that \fBvacuumdb\fR generates and sends to the server. .TP \fB-f\fR .TP \fB--full\fR Perform ``full'' vacuuming. .TP \fB-q\fR .TP \fB--quiet\fR Do not display a response. .TP \fB-t \fItable\fB [ (\fIcolumn\fB [,...]) ]\fR .TP \fB--table \fItable\fB [ (\fIcolumn\fB [,...]) ]\fR Clean or analyze \fItable\fR only. Column names may be specified only in conjunction with the \fB--analyze\fR option. .sp .RS .B "Tip:" If you specify columns to vacuum, you probably have to escape the parentheses from the shell. .RE .sp .TP \fB-v\fR .TP \fB--verbose\fR Print detailed information during processing. .TP \fB-z\fR .TP \fB--analyze\fR Calculate statistics for use by the optimizer. .PP .PP \fBvacuumdb\fR also accepts the following command-line arguments for connection parameters: .TP \fB-h \fIhost\fB\fR .TP \fB--host \fIhost\fB\fR Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. .TP \fB-p \fIport\fB\fR .TP \fB--port \fIport\fB\fR Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. .TP \fB-U \fIusername\fB\fR .TP \fB--username \fIusername\fB\fR User name to connect as .TP \fB-W\fR .TP \fB--password\fR Force password prompt. .PP .SH "DIAGNOSTICS" .PP .TP \fBVACUUM\fR Everything went well. .TP \fBvacuumdb: Vacuum failed.\fR Something went wrong. \fBvacuumdb\fR is only a wrapper script. See VACUUM [\fBvacuum\fR(7)] and \fBpsql\fR(1) for a detailed discussion of error messages and potential problems. .PP .SH "ENVIRONMENT" .TP \fBPGDATABASE\fR .TP \fBPGHOST\fR .TP \fBPGPORT\fR .TP \fBPGUSER\fR Default connection parameters. .SH "EXAMPLES" .PP To clean the database test: .sp .nf $ \fBvacuumdb test\fR .sp .fi .PP To clean and analyze for the optimizer a database named bigdb: .sp .nf $ \fBvacuumdb --analyze bigdb\fR .sp .fi .PP To clean a single table foo in a database named xyzzy, and analyze a single column bar of the table for the optimizer: .sp .nf $ \fBvacuumdb --analyze --verbose --table 'foo(bar)' xyzzy\fR .sp .fi .SH "SEE ALSO" VACUUM [\fBvacuum\fR(7)]