.\\" auto-generated by docbook2man-spec $Revision: 1.25 $ .TH "CLUSTERDB" "1" "2002-11-22" "Application" "PostgreSQL Client Applications" .SH NAME clusterdb \- cluster a PostgreSQL database .SH SYNOPSIS .sp \fBclusterdb\fR\fR [ \fR\fB\fIconnection-options\fB\fR...\fB \fR\fR]\fR\fR [ \fR\fB--table | -t \fItable\fB \fR\fR]\fR\fR [ \fR\fB\fIdbname\fB \fR\fR]\fR \fBclusterdb\fR\fR [ \fR\fB\fIconnection-options\fB\fR...\fB \fR\fR]\fR \fR[\fR \fB--all\fR\fR | \fR\fB-a\fR\fR ]\fR .SH "DESCRIPTION" .PP \fBclusterdb\fR is a utility for reclustering tables in a PostgreSQL database. It finds tables that have previously been clustered, and clusters them again on the same index that was last used. Tables that have never been clustered are not touched. .PP \fBclusterdb\fR is a shell script wrapper around the backend command CLUSTER [\fBcluster\fR(7)] via the PostgreSQL interactive terminal \fBpsql\fR(1). There is no effective difference between clustering databases via this or other methods. \fBpsql\fR must be found by the script and a database server must be running at the targeted host. Also, any default settings and environment variables available to \fBpsql\fR and the \fBlibpq\fR front-end library do apply. .PP \fBclusterdb\fR might need to connect several times to the PostgreSQL server, asking for a password each time. It is convenient to have a \fI$HOME/.pgpass\fR file in such cases. .SH "OPTIONS" .PP \fBclusterdb\fR accepts the following command-line arguments: .TP \fB-a\fR .TP \fB--all\fR Cluster all databases. .TP \fB[-d] \fIdbname\fB\fR .TP \fB[--dbname] \fIdbname\fB\fR Specifies the name of the database to be clustered. If this is not specified and \fB-a\fR (or \fB--all\fR) is not used, the database name is read from the environment variable \fBPGDATABASE\fR. If that is not set, the user name specified for the connection is used. .TP \fB-e\fR .TP \fB--echo\fR Echo the commands that \fBclusterdb\fR generates and sends to the server. .TP \fB-q\fR .TP \fB--quiet\fR Do not display a response. .TP \fB-t \fItable\fB\fR .TP \fB--table \fItable\fB\fR Clusters \fItable\fR only. .PP .PP \fBclusterdb\fR also accepts the following command-line arguments for connection parameters: .TP \fB-h \fIhost\fB\fR .TP \fB--host \fIhost\fB\fR Specifies the host name of the machine on which the server is running. If host begins with a slash, it is used as the directory for the Unix domain socket. .TP \fB-p \fIport\fB\fR .TP \fB--port \fIport\fB\fR Specifies the Internet TCP/IP port or local Unix domain socket file extension on which the server is listening for connections. .TP \fB-U \fIusername\fB\fR .TP \fB--username \fIusername\fB\fR User name to connect as .TP \fB-W\fR .TP \fB--password\fR Force password prompt. .PP .SH "DIAGNOSTICS" .PP .TP \fBCLUSTER\fR Everything went well. .TP \fBclusterdb: Cluster failed.\fR Something went wrong. \fBclusterdb\fR is only a wrapper script. See CLUSTER [\fBcluster\fR(7)] and \fBpsql\fR(1) for a detailed discussion of error messages and potential problems. Note that this message may appear once per table to be clustered. .PP .SH "ENVIRONMENT" .TP \fBPGDATABASE\fR .TP \fBPGHOST\fR .TP \fBPGPORT\fR .TP \fBPGUSER\fR Default connection parameters. .SH "EXAMPLES" .PP To cluster the database test: .sp .nf $ \fBclusterdb test\fR .sp .fi .PP To cluster a single table foo in a database named xyzzy: .sp .nf $ \fBclusterdb --table foo xyzzy\fR .sp .fi .SH "SEE ALSO" CLUSTER [\fBcluster\fR(7)]