1CLUSTERDB(1) PostgreSQL Client Applications CLUSTERDB(1)
2
3
4
6 clusterdb - cluster a PostgreSQL database
7
8
10 clusterdb [ connection-option... ] [ --verbose | -v ] [ --table | -t
11 table ] [ dbname ]
12
13 clusterdb [ connection-option... ] [ --all | -a ] [ --verbose | -v ]
14
16 clusterdb is a utility for reclustering tables in a PostgreSQL data‐
17 base. It finds tables that have previously been clustered, and clusters
18 them again on the same index that was last used. Tables that have never
19 been clustered are not affected.
20
21 clusterdb is a wrapper around the SQL command CLUSTER [cluster(7)].
22 There is no effective difference between clustering databases via this
23 utility and via other methods for accessing the server.
24
26 clusterdb accepts the following command-line arguments:
27
28 -a
29
30 --all Cluster all databases.
31
32 [-d] dbname
33
34 [--dbname] dbname
35 Specifies the name of the database to be clustered. If this is
36 not specified and -a (or --all) is not used, the database name
37 is read from the environment variable PGDATABASE. If that is not
38 set, the user name specified for the connection is used.
39
40 -e
41
42 --echo Echo the commands that clusterdb generates and sends to the
43 server.
44
45 -q
46
47 --quiet
48 Do not display progress messages.
49
50 -t table
51
52 --table table
53 Cluster table only.
54
55 -v
56
57 --verbose
58 Print detailed information during processing.
59
60 clusterdb also accepts the following command-line arguments for connec‐
61 tion parameters:
62
63 -h host
64
65 --host host
66 Specifies the host name of the machine on which the server is
67 running. If the value begins with a slash, it is used as the
68 directory for the Unix domain socket.
69
70 -p port
71
72 --port port
73 Specifies the TCP port or local Unix domain socket file exten‐
74 sion on which the server is listening for connections.
75
76 -U username
77
78 --username username
79 User name to connect as.
80
81 -w
82
83 --no-password
84 Never issue a password prompt. If the server requires password
85 authentication and a password is not available by other means
86 such as a .pgpass file, the connection attempt will fail. This
87 option can be useful in batch jobs and scripts where no user is
88 present to enter a password.
89
90 -W
91
92 --password
93 Force clusterdb to prompt for a password before connecting to a
94 database.
95
96 This option is never essential, since clusterdb will automati‐
97 cally prompt for a password if the server demands password
98 authentication. However, clusterdb will waste a connection
99 attempt finding out that the server wants a password. In some
100 cases it is worth typing -W to avoid the extra connection
101 attempt.
102
104 PGDATABASE
105
106 PGHOST
107
108 PGPORT
109
110 PGUSER Default connection parameters
111
112 This utility, like most other PostgreSQL utilities, also uses the envi‐
113 ronment variables supported by libpq (see in the documentation).
114
116 In case of difficulty, see CLUSTER [cluster(7)] and psql(1) for discus‐
117 sions of potential problems and error messages. The database server
118 must be running at the targeted host. Also, any default connection set‐
119 tings and environment variables used by the libpq front-end library
120 will apply.
121
123 To cluster the database test:
124
125 $ clusterdb test
126
127
128 To cluster a single table foo in a database named xyzzy:
129
130 $ clusterdb --table foo xyzzy
131
132
134 CLUSTER [cluster(7)]
135
136
137
138Application 2011-09-22 CLUSTERDB(1)