Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
app-clusterdb.html122 linesDownload Raw Back to html
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>clusterdb</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="reference-client.html" title="PostgreSQL Client Applications" /><link rel="next" href="app-createdb.html" title="createdb" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center"><span class="application">clusterdb</span></th></tr><tr><td width="10%" align="left"><a accesskey="p" href="reference-client.html" title="PostgreSQL Client Applications">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="reference-client.html" title="PostgreSQL Client Applications">Up</a></td><th width="60%" align="center">PostgreSQL Client Applications</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="app-createdb.html" title="createdb">Next</a></td></tr></table><hr /></div><div class="refentry" id="APP-CLUSTERDB"><div class="titlepage"></div><a id="id-1.9.4.3.1" class="indexterm"></a><div class="refnamediv"><h2><span class="refentrytitle"><span class="application">clusterdb</span></span></h2><p>clusterdb — cluster a <span class="productname">PostgreSQL</span> database</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p id="id-1.9.4.3.4.1"><code class="command">clusterdb</code> [<em class="replaceable"><code>connection-option</code></em>...] [ <code class="option">--verbose</code>  |   <code class="option">-v</code> ]  3     [4         <code class="option">--table</code>  |   <code class="option">-t</code>  5       <em class="replaceable"><code>table</code></em>6     ]7   ...  [<em class="replaceable"><code>dbname</code></em>]</p></div><div class="cmdsynopsis"><p id="id-1.9.4.3.4.2"><code class="command">clusterdb</code> [<em class="replaceable"><code>connection-option</code></em>...] [ <code class="option">--verbose</code>  |   <code class="option">-v</code> ]   <code class="option">--all</code>  |   <code class="option">-a</code>  </p></div></div><div class="refsect1" id="id-1.9.4.3.5"><h2>Description</h2><p>8   <span class="application">clusterdb</span> is a utility for reclustering tables9   in a <span class="productname">PostgreSQL</span> database.  It finds tables10   that have previously been clustered, and clusters them again on the same11   index that was last used.  Tables that have never been clustered are not12   affected.13  </p><p>14   <span class="application">clusterdb</span> is a wrapper around the SQL15   command <a class="xref" href="sql-cluster.html" title="CLUSTER"><span class="refentrytitle">CLUSTER</span></a>.16   There is no effective difference between clustering databases via17   this utility and via other methods for accessing the server.18  </p></div><div class="refsect1" id="id-1.9.4.3.6"><h2>Options</h2><p>19    <span class="application">clusterdb</span> accepts the following command-line arguments:20 21    </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-a</code><br /></span><span class="term"><code class="option">--all</code></span></dt><dd><p>22        Cluster all databases.23       </p></dd><dt><span class="term"><code class="option">[<span class="optional">-d</span>] <em class="replaceable"><code>dbname</code></em></code><br /></span><span class="term"><code class="option">[<span class="optional">--dbname=</span>]<em class="replaceable"><code>dbname</code></em></code></span></dt><dd><p>24        Specifies the name of the database to be clustered,25        when <code class="option">-a</code>/<code class="option">--all</code> is not used.26        If this is not specified, the database name is read27        from the environment variable <code class="envar">PGDATABASE</code>.  If28        that is not set, the user name specified for the connection is29        used.  The <em class="replaceable"><code>dbname</code></em> can be a <a class="link" href="libpq-connect.html#LIBPQ-CONNSTRING" title="34.1.1. Connection Strings">connection string</a>.  If so,30        connection string parameters will override any conflicting command31        line options.32       </p></dd><dt><span class="term"><code class="option">-e</code><br /></span><span class="term"><code class="option">--echo</code></span></dt><dd><p>33        Echo the commands that <span class="application">clusterdb</span> generates34        and sends to the server.35       </p></dd><dt><span class="term"><code class="option">-q</code><br /></span><span class="term"><code class="option">--quiet</code></span></dt><dd><p>36        Do not display progress messages.37       </p></dd><dt><span class="term"><code class="option">-t <em class="replaceable"><code>table</code></em></code><br /></span><span class="term"><code class="option">--table=<em class="replaceable"><code>table</code></em></code></span></dt><dd><p>38        Cluster <em class="replaceable"><code>table</code></em> only.39        Multiple tables can be clustered by writing multiple40        <code class="option">-t</code> switches.41       </p></dd><dt><span class="term"><code class="option">-v</code><br /></span><span class="term"><code class="option">--verbose</code></span></dt><dd><p>42        Print detailed information during processing.43       </p></dd><dt><span class="term"><code class="option">-V</code><br /></span><span class="term"><code class="option">--version</code></span></dt><dd><p>44      Print the <span class="application">clusterdb</span> version and exit.45      </p></dd><dt><span class="term"><code class="option">-?</code><br /></span><span class="term"><code class="option">--help</code></span></dt><dd><p>46      Show help about <span class="application">clusterdb</span> command line47      arguments, and exit.48      </p></dd></dl></div><p>49   </p><p>50    <span class="application">clusterdb</span> also accepts51    the following command-line arguments for connection parameters:52 53    </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">-h <em class="replaceable"><code>host</code></em></code><br /></span><span class="term"><code class="option">--host=<em class="replaceable"><code>host</code></em></code></span></dt><dd><p>54        Specifies the host name of the machine on which the server is55        running.  If the value begins with a slash, it is used as the56        directory for the Unix domain socket.57       </p></dd><dt><span class="term"><code class="option">-p <em class="replaceable"><code>port</code></em></code><br /></span><span class="term"><code class="option">--port=<em class="replaceable"><code>port</code></em></code></span></dt><dd><p>58        Specifies the TCP port or local Unix domain socket file59        extension on which the server60        is listening for connections.61       </p></dd><dt><span class="term"><code class="option">-U <em class="replaceable"><code>username</code></em></code><br /></span><span class="term"><code class="option">--username=<em class="replaceable"><code>username</code></em></code></span></dt><dd><p>62        User name to connect as.63       </p></dd><dt><span class="term"><code class="option">-w</code><br /></span><span class="term"><code class="option">--no-password</code></span></dt><dd><p>64        Never issue a password prompt.  If the server requires65        password authentication and a password is not available by66        other means such as a <code class="filename">.pgpass</code> file, the67        connection attempt will fail.  This option can be useful in68        batch jobs and scripts where no user is present to enter a69        password.70       </p></dd><dt><span class="term"><code class="option">-W</code><br /></span><span class="term"><code class="option">--password</code></span></dt><dd><p>71        Force <span class="application">clusterdb</span> to prompt for a72        password before connecting to a database.73       </p><p>74        This option is never essential, since75        <span class="application">clusterdb</span> will automatically prompt76        for a password if the server demands password authentication.77        However, <span class="application">clusterdb</span> will waste a78        connection attempt finding out that the server wants a password.79        In some cases it is worth typing <code class="option">-W</code> to avoid the extra80        connection attempt.81       </p></dd><dt><span class="term"><code class="option">--maintenance-db=<em class="replaceable"><code>dbname</code></em></code></span></dt><dd><p>82        Specifies the name of the database to connect to to discover which83        databases should be clustered,84        when <code class="option">-a</code>/<code class="option">--all</code> is used.85        If not specified, the <code class="literal">postgres</code> database will be used,86        or if that does not exist, <code class="literal">template1</code> will be used.87        This can be a <a class="link" href="libpq-connect.html#LIBPQ-CONNSTRING" title="34.1.1. Connection Strings">connection88        string</a>.  If so, connection string parameters will override any89        conflicting command line options.  Also, connection string parameters90        other than the database name itself will be re-used when connecting91        to other databases.92       </p></dd></dl></div><p>93   </p></div><div class="refsect1" id="id-1.9.4.3.7"><h2>Environment</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">PGDATABASE</code><br /></span><span class="term"><code class="envar">PGHOST</code><br /></span><span class="term"><code class="envar">PGPORT</code><br /></span><span class="term"><code class="envar">PGUSER</code></span></dt><dd><p>94      Default connection parameters95     </p></dd><dt><span class="term"><code class="envar">PG_COLOR</code></span></dt><dd><p>96      Specifies whether to use color in diagnostic messages. Possible values97      are <code class="literal">always</code>, <code class="literal">auto</code> and98      <code class="literal">never</code>.99     </p></dd></dl></div><p>100   This utility, like most other <span class="productname">PostgreSQL</span> utilities,101   also uses the environment variables supported by <span class="application">libpq</span>102   (see <a class="xref" href="libpq-envars.html" title="34.15. Environment Variables">Section 34.15</a>).103  </p></div><div class="refsect1" id="id-1.9.4.3.8"><h2>Diagnostics</h2><p>104   In case of difficulty, see <a class="xref" href="sql-cluster.html" title="CLUSTER"><span class="refentrytitle">CLUSTER</span></a>105   and <a class="xref" href="app-psql.html" title="psql"><span class="refentrytitle"><span class="application">psql</span></span></a> for106   discussions of potential problems and error messages.107   The database server must be running at the108   targeted host.  Also, any default connection settings and environment109   variables used by the <span class="application">libpq</span> front-end110   library will apply.111  </p></div><div class="refsect1" id="id-1.9.4.3.9"><h2>Examples</h2><p>112    To cluster the database <code class="literal">test</code>:113</p><pre class="screen">114<code class="prompt">$ </code><strong class="userinput"><code>clusterdb test</code></strong>115</pre><p>116   </p><p>117    To cluster a single table118    <code class="literal">foo</code> in a database named119    <code class="literal">xyzzy</code>:120</p><pre class="screen">121<code class="prompt">$ </code><strong class="userinput"><code>clusterdb --table=foo xyzzy</code></strong>122</pre></div><div class="refsect1" id="id-1.9.4.3.10"><h2>See Also</h2><span class="simplelist"><a class="xref" href="sql-cluster.html" title="CLUSTER"><span class="refentrytitle">CLUSTER</span></a></span></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="reference-client.html" title="PostgreSQL Client Applications">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-client.html" title="PostgreSQL Client Applications">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="app-createdb.html" title="createdb">Next</a></td></tr><tr><td width="40%" align="left" valign="top">PostgreSQL Client Applications </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> <span class="application">createdb</span></td></tr></table></div></body></html>
codekingpro/portable-devtools · Team Ai