1CLUSTERDB(1)            PostgreSQL Client Applications            CLUSTERDB(1)
2
3
4

NAME

6       clusterdb - cluster a PostgreSQL database
7
8

SYNOPSIS

10       clusterdb  [  connection-option...  ]   [   [ --verbose ]  [ -v ]  ]  [
11       --table | -t table  ]  [ dbname ]
12
13       clusterdb [ connection-option... ]  [  [ --all ]   [  -a  ]   ]   [   [
14       --verbose ]  [ -v ]  ]
15

DESCRIPTION

17       clusterdb  is  a  utility for reclustering tables in a PostgreSQL data‐
18       base. It finds tables that have previously been clustered, and clusters
19       them again on the same index that was last used. Tables that have never
20       been clustered are not affected.
21
22       clusterdb is a wrapper around the  SQL  command  CLUSTER  [cluster(7)].
23       There  is no effective difference between clustering databases via this
24       utility and via other methods for accessing the server.
25

OPTIONS

27       clusterdb accepts the following command-line arguments:
28
29       -a
30
31       --all  Cluster all databases.
32
33       [-d] dbname
34
35       [--dbname] dbname
36              Specifies the name of the database to be clustered.  If this  is
37              not  specified  and -a (or --all) is not used, the database name
38              is read from the environment variable PGDATABASE. If that is not
39              set, the user name specified for the connection is used.
40
41       -e
42
43       --echo Echo  the  commands  that  clusterdb  generates and sends to the
44              server.
45
46       -q
47
48       --quiet
49              Do not display progress messages.
50
51       -t table
52
53       --table table
54              Cluster table only.
55
56       -v
57
58       --verbose
59              Print detailed information during processing.
60
61       clusterdb also accepts the following command-line arguments for connec‐
62       tion parameters:
63
64       -h host
65
66       --host host
67              Specifies  the  host  name of the machine on which the server is
68              running. If the value begins with a slash, it  is  used  as  the
69              directory for the Unix domain socket.
70
71       -p port
72
73       --port port
74              Specifies  the  TCP port or local Unix domain socket file exten‐
75              sion on which the server is listening for connections.
76
77       -U username
78
79       --username username
80              User name to connect as.
81
82       -w
83
84       --no-password
85              Never issue a password prompt. If the server  requires  password
86              authentication  and  a  password is not available by other means
87              such as a .pgpass file, the connection attempt will  fail.  This
88              option  can be useful in batch jobs and scripts where no user is
89              present to enter a password.
90
91       -W
92
93       --password
94              Force clusterdb to prompt for a password before connecting to  a
95              database.
96
97              This  option  is never essential, since clusterdb will automati‐
98              cally prompt for a  password  if  the  server  demands  password
99              authentication.   However,  clusterdb  will  waste  a connection
100              attempt finding out that the server wants a password.   In  some
101              cases  it  is  worth  typing  -W  to  avoid the extra connection
102              attempt.
103

ENVIRONMENT

105       PGDATABASE
106
107       PGHOST
108
109       PGPORT
110
111       PGUSER Default connection parameters
112
113       This utility, like most other PostgreSQL utilities, also uses the envi‐
114       ronment variables supported by libpq (see in the documentation).
115

DIAGNOSTICS

117       In case of difficulty, see CLUSTER [cluster(7)] and psql(1) for discus‐
118       sions of potential problems and error messages.   The  database  server
119       must be running at the targeted host. Also, any default connection set‐
120       tings and environment variables used by  the  libpq  front-end  library
121       will apply.
122

EXAMPLES

124       To cluster the database test:
125
126       $ clusterdb test
127
128
129       To cluster a single table foo in a database named xyzzy:
130
131       $ clusterdb --table foo xyzzy
132
133

SEE ALSO

135       CLUSTER [cluster(7)]
136
137
138
139Application                       2014-02-17                      CLUSTERDB(1)
Impressum