]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/vacuumdb.sgml
Okay, that should put us back in sync. These two patches (src & doc) are
[postgresql] / doc / src / sgml / ref / vacuumdb.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v 1.6 1999/12/07 22:41:41 momjian Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-VACUUMDB">
7  <refmeta>
8   <refentrytitle id="APP-VACUUMDB-TITLE">
9    <application>vacuumdb</application>
10   </refentrytitle>
11   <refmiscinfo>Application</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname id="vacuumdb">
15    <application>vacuumdb</application>
16   </refname>
17   <refpurpose>
18    Clean and analyze a <productname>PostgreSQL</productname> database
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-12-04</date>
24   </refsynopsisdivinfo>
25   <synopsis>
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> ]
28   </synopsis>
29
30   <refsect2 id="R2-APP-VACUUMDB-1">
31    <refsect2info>
32     <date>1999-12-04</date>
33    </refsect2info>
34    <title>
35     Inputs
36    </title>
37    <para>
38     <application>vacuumdb</application> accepts the following command line arguments:
39     
40     <variablelist>
41      <varlistentry>
42       <term>[-d, --dbname] <replaceable class="parameter">dbname</replaceable></term>
43       <listitem>
44        <para>
45         Specifies the name of the database to be cleaned or analyzed.
46        </para>
47       </listitem>
48      </varlistentry>
49
50      <varlistentry>
51       <term>-z, --analyze</term>
52       <listitem>
53        <para>
54         Calculate statistics on the database for use by the optimizer.
55        </para>
56       </listitem>
57      </varlistentry>
58
59      <varlistentry>
60       <term>-v, --verbose</term>
61       <listitem>
62        <para>
63         Print detailed information during processing.
64        </para>
65       </listitem>
66      </varlistentry>
67
68      <varlistentry>
69       <term>-t, --table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]</term>
70       <listitem>
71        <para>
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.
75        </para>
76        <tip>
77         <para>
78          If you specify columns to vacuum, you probably have to escape the parentheses
79          from the shell.
80         </para>
81        </tip>
82       </listitem>
83      </varlistentry>
84
85     </variablelist>
86    </para>
87
88    <para>
89     <application>vacuumdb</application> also accepts 
90     the following command line arguments for connection parameters:
91     
92     <variablelist>
93      <varlistentry>
94       <term>-h, --host <replaceable class="parameter">host</replaceable></term>
95       <listitem>
96        <para>
97         Specifies the hostname of the machine on which the 
98         <application>postmaster</application>
99         is running.
100        </para>
101       </listitem>
102      </varlistentry>
103
104      <varlistentry>
105       <term>-p, --port <replaceable class="parameter">port</replaceable></term>
106       <listitem>
107        <para>
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.
111        </para>
112       </listitem>
113      </varlistentry>
114
115      <varlistentry>
116       <term>-U, --username <replaceable class="parameter">username</replaceable></term>
117       <listitem>
118        <para>
119         Username to connect as.
120        </para>
121       </listitem>
122      </varlistentry>
123
124      <varlistentry>
125       <term>-W, --password</term>
126       <listitem>
127        <para>
128         Force password prompt.
129        </para>
130       </listitem>
131      </varlistentry>
132
133      <varlistentry>
134       <term>-e, --echo</term>
135       <listitem>
136        <para>
137         Echo the commands that <application>vacuumdb</application> generates
138         and sends to the backend.
139        </para>
140       </listitem>
141      </varlistentry>
142
143      <varlistentry>
144       <term>-q, --quiet</term>
145       <listitem>
146        <para>
147         Do not display a response.
148        </para>
149       </listitem>
150      </varlistentry>
151     </variablelist>
152    </para>
153   </refsect2>
154
155   <refsect2 id="R2-APP-VACUUMDB-2">
156    <refsect2info>
157     <date>1999-12-04</date>
158    </refsect2info>
159    <title>
160     Outputs
161    </title>
162    <para>
163     <variablelist>
164      <varlistentry>
165       <term><computeroutput>VACUUM</computeroutput></term>
166       <listitem>
167        <para>
168         Everything went well.
169        </para>
170       </listitem>
171      </varlistentry>
172
173      <varlistentry>
174       <term><computeroutput>vacuumdb: Vacuum failed.</computeroutput></term>
175       <listitem>
176        <para>
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.
181        </para>
182       </listitem>
183      </varlistentry>
184
185     </variablelist>
186    </para>
187
188    <para>
189    </para>
190
191   </refsect2>
192  </refsynopsisdiv>
193  
194  <refsect1 id="R1-APP-VACUUMDB-1">
195   <refsect1info>
196    <date>1999-12-04</date>
197   </refsect1info>
198   <title>
199    Description
200   </title>
201
202   <para>
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.
207   </para>
208
209   <para>
210    <application>vacuumdb</application> is a shell script wrapper around the
211    backend command
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.
220   </para>
221
222  </refsect1>
223
224  <refsect1 id="R1-APP-VACUUMDB-3">
225   <refsect1info>
226    <date>1998-10-04</date>
227   </refsect1info>
228   <title>
229    Usage
230   </title>
231
232   <para>
233    To clean the database <literal>test</literal>:
234 <programlisting>
235 $ vacuumdb test
236 </programlisting>
237   </para>
238
239   <para>
240    To analyze a database named <literal>bigdb</literal> for the optimizer:
241 <programlisting>
242 $ vacuumdb --analyze bigdb
243 </programlisting>
244   </para>
245
246   <para>
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:
249 <programlisting>
250 $ vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
251 </programlisting>
252   </para>
253
254  </refsect1>
255 </refentry>
256
257 <!-- Keep this comment at the end of the file
258 Local variables:
259 mode: sgml
260 sgml-omittag:nil
261 sgml-shorttag:t
262 sgml-minimize-attributes:nil
263 sgml-always-quote-attributes:t
264 sgml-indent-step:1
265 sgml-indent-data: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
271 End:
272 -->