2
$PostgreSQL: pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.16 2003-11-29 19:51:38 pgsql Exp $
3
PostgreSQL documentation
6
<refentry id="APP-CLUSTERDB">
8
<refentrytitle id="APP-CLUSTERDB-TITLE"><application>clusterdb</application></refentrytitle>
9
<manvolnum>1</manvolnum>
10
<refmiscinfo>Application</refmiscinfo>
14
<refname id="clusterdb">clusterdb</refname>
15
<refpurpose>cluster a <productname>PostgreSQL</productname> database</refpurpose>
18
<indexterm zone="app-clusterdb">
19
<primary>clusterdb</primary>
24
<command>clusterdb</command>
25
<arg rep="repeat"><replaceable>connection-option</replaceable></arg>
26
<arg>--table | -t <replaceable>table</replaceable> </arg>
27
<arg><replaceable>dbname</replaceable></arg>
29
<command>clusterdb</command>
30
<arg rep="repeat"><replaceable>connection-option</replaceable></arg>
31
<group><arg>--all</arg><arg>-a</arg></group>
37
<title>Description</title>
40
<application>clusterdb</application> is a utility for reclustering tables
41
in a <productname>PostgreSQL</productname> database. It finds tables
42
that have previously been clustered, and clusters them again on the same
43
index that was last used. Tables that have never been clustered are not
48
<application>clusterdb</application> is a wrapper around the SQL
49
command <xref linkend="SQL-CLUSTER" endterm="sql-cluster-title">.
50
There is no effective difference between clustering databases via
51
this utility and via other methods for accessing the server.
58
<title>Options</title>
61
<application>clusterdb</application> accepts the following command-line arguments:
65
<term><option>-a</></term>
66
<term><option>--all</></term>
69
Cluster all databases.
75
<term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term>
76
<term><option><optional>--dbname</> <replaceable class="parameter">dbname</replaceable></></term>
79
Specifies the name of the database to be clustered.
80
If this is not specified and <option>-a</option> (or
81
<option>--all</option>) is not used, the database name is read
82
from the environment variable <envar>PGDATABASE</envar>. If
83
that is not set, the user name specified for the connection is
90
<term><option>-e</></term>
91
<term><option>--echo</></term>
94
Echo the commands that <application>clusterdb</application> generates
95
and sends to the server.
101
<term><option>-q</></term>
102
<term><option>--quiet</></term>
105
Do not display a response.
111
<term><option>-t <replaceable class="parameter">table</replaceable></></term>
112
<term><option>--table <replaceable class="parameter">table</replaceable></></term>
115
Cluster <replaceable class="parameter">table</replaceable> only.
124
<application>clusterdb</application> also accepts
125
the following command-line arguments for connection parameters:
129
<term><option>-h <replaceable class="parameter">host</replaceable></></term>
130
<term><option>--host <replaceable class="parameter">host</replaceable></></term>
133
Specifies the host name of the machine on which the server is
134
running. If the value begins with a slash, it is used as the
135
directory for the Unix domain socket.
141
<term><option>-p <replaceable class="parameter">port</replaceable></></term>
142
<term><option>--port <replaceable class="parameter">port</replaceable></></term>
145
Specifies the TCP port or local Unix domain socket file
146
extension on which the server
147
is listening for connections.
153
<term><option>-U <replaceable class="parameter">username</replaceable></></term>
154
<term><option>--username <replaceable class="parameter">username</replaceable></></term>
157
User name to connect as.
163
<term><option>-W</></term>
164
<term><option>--password</></term>
167
Force password prompt.
177
<title>Environment</title>
181
<term><envar>PGDATABASE</envar></term>
182
<term><envar>PGHOST</envar></term>
183
<term><envar>PGPORT</envar></term>
184
<term><envar>PGUSER</envar></term>
188
Default connection parameters
197
<title>Diagnostics</title>
200
In case of difficulty, see <xref linkend="SQL-CLUSTER"
201
endterm="sql-cluster-title"> and <xref linkend="APP-PSQL"> for
202
discussions of potential problems and error messages.
203
The database server must be running at the
204
targeted host. Also, any default connection settings and environment
205
variables used by the <application>libpq</application> front-end
213
<title>Examples</title>
216
To cluster the database <literal>test</literal>:
218
<prompt>$ </prompt><userinput>clusterdb test</userinput>
223
To cluster a single table
224
<literal>foo</literal> in a database named
225
<literal>xyzzy</literal>:
227
<prompt>$ </prompt><userinput>clusterdb --table foo xyzzy</userinput>
234
<title>See Also</title>
236
<simplelist type="inline">
237
<member><xref linkend="sql-cluster" endterm="sql-cluster-title"></member>
243
<!-- Keep this comment at the end of the file
248
sgml-minimize-attributes:nil
249
sgml-always-quote-attributes:t
252
sgml-parent-document:nil
253
sgml-default-dtd-file:"../reference.ced"
254
sgml-exposed-tags:nil
255
sgml-local-catalogs:"/usr/lib/sgml/catalog"
256
sgml-local-ecat-files:nil