2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.6 1999/12/07 22:41:41 momjian Exp $
6 <refentry id="APP-VACUUMDB">
8 <refentrytitle id="APP-VACUUMDB-TITLE">
9 <application>vacuumdb</application>
11 <refmiscinfo>Application</refmiscinfo>
14 <refname id="vacuumdb">
15 <application>vacuumdb</application>
18 Clean and analyze a <productname>PostgreSQL</productname> database
23 <date>1999-12-04</date>
26 vacuumdb [ <replaceable class="parameter">connection options</replaceable> ] [ --analyze | -z ] [ --verbose | -v ]
27 [ --table '<replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column</replaceable> [,...] ) ]' ] [ [-d] <replaceable class="parameter">dbname</replaceable> ]
30 <refsect2 id="R2-APP-VACUUMDB-1">
32 <date>1999-12-04</date>
38 <application>vacuumdb</application> accepts the following command line arguments:
42 <term>[-d, --dbname] <replaceable class="parameter">dbname</replaceable></term>
45 Specifies the name of the database to be cleaned or analyzed.
51 <term>-z, --analyze</term>
54 Calculate statistics on the database for use by the optimizer.
60 <term>-v, --verbose</term>
63 Print detailed information during processing.
69 <term>-t, --table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
72 Clean or analyze <replaceable class="parameter">table</replaceable> only.
73 Column names may be specified only in conjunction with
74 the <option>--analyze</option> option.
78 If you specify columns to vacuum, you probably have to escape the parentheses
89 <application>vacuumdb</application> also accepts
90 the following command line arguments for connection parameters:
94 <term>-h, --host <replaceable class="parameter">host</replaceable></term>
97 Specifies the hostname of the machine on which the
98 <application>postmaster</application>
105 <term>-p, --port <replaceable class="parameter">port</replaceable></term>
108 Specifies the Internet TCP/IP port or local Unix domain socket file
109 extension on which the <application>postmaster</application>
110 is listening for connections.
116 <term>-U, --username <replaceable class="parameter">username</replaceable></term>
119 Username to connect as.
125 <term>-W, --password</term>
128 Force password prompt.
134 <term>-e, --echo</term>
137 Echo the commands that <application>vacuumdb</application> generates
138 and sends to the backend.
144 <term>-q, --quiet</term>
147 Do not display a response.
155 <refsect2 id="R2-APP-VACUUMDB-2">
157 <date>1999-12-04</date>
165 <term><computeroutput>VACUUM</computeroutput></term>
168 Everything went well.
174 <term><computeroutput>vacuumdb: Vacuum failed.</computeroutput></term>
177 Something went wrong. <application>vacuumdb</application> is only a wrapper
178 script. See <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title">
179 and <xref linkend="APP-PSQL" endterm="APP-PSQL-title"> for a detailed
180 discussion of error messages and potential problems.
194 <refsect1 id="R1-APP-VACUUMDB-1">
196 <date>1999-12-04</date>
203 <application>vacuumdb</application> is a utility for cleaning a
204 <productname>PostgreSQL</productname> database.
205 <application>vacuumdb</application> will also generate internal statistics
206 used by the <productname>Postgres</productname> query optimizer.
210 <application>vacuumdb</application> is a shell script wrapper around the
212 <xref linkend="SQL-VACUUM" endterm="SQL-VACUUM-title"> via
213 the <productname>PostgreSQL</productname> interactive terminal
214 <xref linkend="APP-PSQL" endterm="APP-PSQL-title">. There is no effective
215 difference between vacuuming databases via this or other methods.
216 <application>psql</application> must be found by the script and
217 a database server must be running at the targeted host. Also, any default
218 settings and environment variables available to <application>psql</application>
219 and the <application>libpq</application> front-end library do apply.
224 <refsect1 id="R1-APP-VACUUMDB-3">
226 <date>1998-10-04</date>
233 To clean the database <literal>test</literal>:
240 To analyze a database named <literal>bigdb</literal> for the optimizer:
242 $ vacuumdb --analyze bigdb
247 To analyze a single column <literal>bar</literal> in table <literal>foo</literal>
248 in a database named <literal>xyzzy</literal> for the optimizer:
250 $ vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
257 <!-- Keep this comment at the end of the file
262 sgml-minimize-attributes:nil
263 sgml-always-quote-attributes:t
266 sgml-parent-document:nil
267 sgml-default-dtd-file:"../reference.ced"
268 sgml-exposed-tags:nil
269 sgml-local-catalogs:"/usr/lib/sgml/catalog"
270 sgml-local-ecat-files:nil