Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e44087d

Browse files
author
Thomas G. Lockhart
committed
Add reference page for new vacuumdb utility.
1 parent 9f07f8f commit e44087d

File tree

3 files changed

+257
-0
lines changed

3 files changed

+257
-0
lines changed

doc/src/sgml/ref/allfiles.sgml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@
121121
<!entity pgDumpall system "pg_dumpall.sgml">
122122
<!entity pgUpgrade system "pg_upgrade.sgml">
123123
<!entity psqlRef system "psql-ref.sgml">
124+
<!entity vacuumdb system "vacuumdb.sgml">

doc/src/sgml/ref/commands.sgml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ This is reference information for the
101101
&pgDump;
102102
&pgDumpall;
103103
&psqlRef;
104+
&vacuumdb;
104105

105106
</chapter>
106107

doc/src/sgml/ref/vacuumdb.sgml

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
<REFENTRY ID="APP-VACUUMDB">
2+
<REFMETA>
3+
<REFENTRYTITLE>
4+
<application>vacuumdb</application>
5+
</REFENTRYTITLE>
6+
<REFMISCINFO>Application</REFMISCINFO>
7+
</REFMETA>
8+
<REFNAMEDIV>
9+
<REFNAME id="vacuumdb">
10+
<application>vacuumdb</application>
11+
</REFNAME>
12+
<REFPURPOSE>
13+
Clean and analyze a <productname>Postgres</productname> database
14+
</REFPURPOSE>
15+
<REFSYNOPSISDIV>
16+
<REFSYNOPSISDIVINFO>
17+
<DATE>1998-10-04</DATE>
18+
</REFSYNOPSISDIVINFO>
19+
<SYNOPSIS>
20+
vacuumdb [ --analyze | -z ] [ --verbose | -v ] [ <replaceable class="parameter">dbname</replaceable> ]
21+
vacuumdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
22+
[ --table '<replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column</replaceable> [,...] ) ]' ]
23+
[ <replaceable class="parameter">dbname</replaceable> ]
24+
</SYNOPSIS>
25+
26+
<REFSECT2 ID="R2-APP-VACUUMDB-1">
27+
<REFSECT2INFO>
28+
<DATE>1998-10-04</DATE>
29+
</REFSECT2INFO>
30+
<TITLE>
31+
Inputs
32+
</TITLE>
33+
<PARA>
34+
<application>vacuumdb</application> accepts the following command line arguments:
35+
36+
<variablelist>
37+
<varlistentry>
38+
<term>
39+
<replaceable class="parameter">dbname</replaceable>
40+
</term>
41+
<listitem>
42+
<para>
43+
Specifies the name of the database to be cleaned or analyzed.
44+
<replaceable class="parameter">dbname</replaceable>
45+
defaults to the value of the
46+
<envar>USER</envar>
47+
environment variable.
48+
49+
<varlistentry>
50+
<term>
51+
--analyze
52+
</term>
53+
<term>
54+
-z
55+
</term>
56+
<listitem>
57+
<para>
58+
Calculate statistics on the database for use by the optimizer.
59+
60+
<varlistentry>
61+
<term>
62+
--verbose
63+
</term>
64+
<term>
65+
-v
66+
</term>
67+
<listitem>
68+
<para>
69+
Print detailed information during processing.
70+
71+
<varlistentry>
72+
<term>
73+
--table <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]
74+
</term>
75+
<term>
76+
-t <replaceable class="parameter">table</replaceable> [ (<replaceable class="parameter">column</replaceable> [,...]) ]
77+
</term>
78+
<listitem>
79+
<para>
80+
Clean or analyze <replaceable class="parameter">table</replaceable> only.
81+
Column names may be specified only in conjunction with
82+
the <option>--analyze</option> option.
83+
84+
</variablelist>
85+
86+
<para>
87+
<application>vacuumdb</application> also accepts
88+
the following command line arguments for connection parameters:
89+
90+
<variablelist>
91+
<varlistentry>
92+
<term>
93+
-h <replaceable class="parameter">host</replaceable>
94+
</term>
95+
<listitem>
96+
<para>
97+
Specifies the hostname of the machine on which the
98+
<application>postmaster</application>
99+
is running. Defaults to using a local Unix domain socket
100+
rather than an IP connection..
101+
102+
<varlistentry>
103+
<term>
104+
-p <replaceable class="parameter">port</replaceable>
105+
</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. The port number defaults to 5432,
111+
or the value of the <envar>PGPORT</envar>
112+
environment variable (if set).
113+
114+
<varlistentry>
115+
<term>
116+
-u
117+
</term>
118+
<listitem>
119+
<para>
120+
Use password authentication.
121+
Prompts for
122+
<replaceable class="parameter">username</replaceable>
123+
and <replaceable class="parameter">password</replaceable>.
124+
125+
</variablelist>
126+
127+
<REFSECT2 ID="R2-APP-VACUUMDB-2">
128+
<REFSECT2INFO>
129+
<DATE>1998-10-04</DATE>
130+
</REFSECT2INFO>
131+
<TITLE>
132+
Outputs
133+
</TITLE>
134+
<PARA>
135+
<application>vacuumdb</application> executes a <command>VACUUM</command> command
136+
on the specified database, so has not explicit external output.
137+
138+
<variablelist>
139+
<varlistentry>
140+
<term>
141+
ERROR: Can't vacuum columns, only tables. You can 'vacuum analyze' columns.
142+
vacuumdb: database vacuum failed on <replaceable class="parameter">dbname</replaceable>.
143+
<listitem>
144+
<para>
145+
The non-analyze mode requires cleaning full tables or databases.
146+
Individual columns may be specified only when analyzing a specific table.
147+
148+
<varlistentry>
149+
<term>
150+
Connection to database 'template1' failed.
151+
connectDB() failed: Is the postmaster running and accepting connections
152+
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
153+
<listitem>
154+
<para>
155+
<application>vacuumdb</application> could not attach to the
156+
<application>postmaster</application>
157+
process on the specified host and port. If you see this message,
158+
ensure that the <application>postmaster</application>
159+
is running on the proper host and that you have specified the proper
160+
port. If your site uses an authentication system, ensure that you
161+
have obtained the required authentication credentials.
162+
163+
<varlistentry>
164+
<term>
165+
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
166+
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
167+
<listitem>
168+
<para>
169+
You do not have a valid entry in the relation <literal>pg_shadow</literal>
170+
and and will not be allowed to access <productname>Postgres</productname>.
171+
Contact your <productname>Postgres</productname> administrator.
172+
173+
</variablelist>
174+
175+
<note>
176+
<para>
177+
<application>vacuumdb</application> internally executes a
178+
<command>VACUUM</command> <acronym>SQL</acronym> statement.
179+
If you have problems running <application>vacuumdb</application>,
180+
make sure you are able to run <command>VACUUM</command> on the database using, for
181+
example, <application>psql</application>.
182+
</note>
183+
184+
<REFSECT1 ID="R1-APP-VACUUMDB-1">
185+
<REFSECT1INFO>
186+
<DATE>1998-10-04</DATE>
187+
</REFSECT1INFO>
188+
<TITLE>
189+
Description
190+
</TITLE>
191+
192+
<PARA>
193+
<application>vacuumdb</application> is a utility for cleaning a
194+
<productname>Postgres</productname> database.
195+
<application>vacuumdb</application> will also generate internal statistics
196+
used by the <productname>Postgres</productname> query optimizer.
197+
198+
<REFSECT1 ID="R1-APP-VACUUMDB-2">
199+
<REFSECT1INFO>
200+
<DATE>1998-10-04</DATE>
201+
</REFSECT1INFO>
202+
<TITLE>
203+
Notes
204+
</TITLE>
205+
206+
<para>
207+
See <xref linkend="vacuum" endterm="vacuum"> for more details.
208+
209+
<REFSECT1 ID="R1-APP-VACUUMDB-3">
210+
<REFSECT1INFO>
211+
<DATE>1998-10-04</DATE>
212+
</REFSECT1INFO>
213+
<TITLE>
214+
Usage
215+
</TITLE>
216+
<PARA>
217+
To clean a database of the same name as the user:
218+
219+
<programlisting>
220+
% vacuumdb
221+
</programlisting>
222+
223+
<para>
224+
To analyze a database named <literal>bigdb</literal> for the optimizer:
225+
226+
<programlisting>
227+
% vacuumdb --analyze bigdb
228+
</programlisting>
229+
230+
<para>
231+
To analyze a single column <literal>bar</literal> in table <literal>foo</literal>
232+
in a database named <literal>xyzzy</literal> for the optimizer:
233+
234+
<programlisting>
235+
% vacuumdb --analyze --verbose --table 'foo(bar)' xyzzy
236+
</programlisting>
237+
238+
</REFENTRY>
239+
240+
<!-- Keep this comment at the end of the file
241+
Local variables:
242+
mode: sgml
243+
sgml-omittag:t
244+
sgml-shorttag:t
245+
sgml-minimize-attributes:nil
246+
sgml-always-quote-attributes:t
247+
sgml-indent-step:1
248+
sgml-indent-data:t
249+
sgml-parent-document:nil
250+
sgml-default-dtd-file:"../reference.ced"
251+
sgml-exposed-tags:nil
252+
sgml-local-catalogs:"/usr/lib/sgml/catalog"
253+
sgml-local-ecat-files:nil
254+
End:
255+
-->

0 commit comments

Comments
 (0)