1CLUSTERDB(1) PostgreSQL Client Applications CLUSTERDB(1)
2
3
4
6 clusterdb - cluster a PostgreSQL database
7
8
10 clusterdb [ connection-option... ] [ --table | -t table ] [ dbname ]
11
12 clusterdb [ connection-option... ] [ [ --all ] [ -a ] ]
13
15 clusterdb is a utility for reclustering tables in a PostgreSQL data‐
16 base. It finds tables that have previously been clustered, and clusters
17 them again on the same index that was last used. Tables that have never
18 been clustered are not affected.
19
20 clusterdb is a wrapper around the SQL command CLUSTER [cluster(7)].
21 There is no effective difference between clustering databases via this
22 utility and via other methods for accessing the server.
23
25 clusterdb accepts the following command-line arguments:
26
27 -a
28
29 --all Cluster all databases.
30
31 [-d] dbname
32
33 [--dbname] dbname
34 Specifies the name of the database to be clustered. If this is
35 not specified and -a (or --all) is not used, the database name
36 is read from the environment variable PGDATABASE. If that is not
37 set, the user name specified for the connection is used.
38
39 -e
40
41 --echo Echo the commands that clusterdb generates and sends to the
42 server.
43
44 -q
45
46 --quiet
47 Do not display a response.
48
49 -t table
50
51 --table table
52 Cluster table only.
53
54 clusterdb also accepts the following command-line arguments for connec‐
55 tion parameters:
56
57 -h host
58
59 --host host
60 Specifies the host name of the machine on which the server is
61 running. If the value begins with a slash, it is used as the
62 directory for the Unix domain socket.
63
64 -p port
65
66 --port port
67 Specifies the TCP port or local Unix domain socket file exten‐
68 sion on which the server is listening for connections.
69
70 -U username
71
72 --username username
73 User name to connect as.
74
75 -W
76
77 --password
78 Force password prompt.
79
81 PGDATABASE
82
83 PGHOST
84
85 PGPORT
86
87 PGUSER Default connection parameters
88
89 This utility, like most other PostgreSQL utilities, also uses the envi‐
90 ronment variables supported by libpq (see in the documentation).
91
93 In case of difficulty, see CLUSTER [cluster(7)] and psql(1) for discus‐
94 sions of potential problems and error messages. The database server
95 must be running at the targeted host. Also, any default connection set‐
96 tings and environment variables used by the libpq front-end library
97 will apply.
98
100 To cluster the database test:
101
102 $ clusterdb test
103
104
105 To cluster a single table foo in a database named xyzzy:
106
107 $ clusterdb --table foo xyzzy
108
109
111 CLUSTER [cluster(7)]
112
113
114
115Application 2008-06-08 CLUSTERDB(1)