Home Explore Blog CI



postgresql

1st chunk of `doc/src/sgml/ref/reindexdb.sgml`
deb47ae022fe62bb72a6ad7dfa0a3204dc124cf920601c900000000100000fa1
<!--
doc/src/sgml/ref/reindexdb.sgml
PostgreSQL documentation
-->

<refentry id="app-reindexdb">
 <indexterm zone="app-reindexdb">
  <primary>reindexdb</primary>
 </indexterm>

 <refmeta>
  <refentrytitle><application>reindexdb</application></refentrytitle>
  <manvolnum>1</manvolnum>
  <refmiscinfo>Application</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>reindexdb</refname>
  <refpurpose>reindex a <productname>PostgreSQL</productname> database</refpurpose>
 </refnamediv>

 <refsynopsisdiv>
  <cmdsynopsis>
   <command>reindexdb</command>
   <arg rep="repeat"><replaceable>connection-option</replaceable></arg>
   <arg rep="repeat"><replaceable>option</replaceable></arg>

   <arg choice="plain" rep="repeat">
    <arg choice="opt">
     <group choice="plain">
      <arg choice="plain"><option>-S</option></arg>
      <arg choice="plain"><option>--schema</option></arg>
     </group>
     <replaceable>schema</replaceable>
    </arg>
   </arg>

   <arg choice="plain" rep="repeat">
    <arg choice="opt">
     <group choice="plain">
      <arg choice="plain"><option>-t</option></arg>
      <arg choice="plain"><option>--table</option></arg>
     </group>
     <replaceable>table</replaceable>
    </arg>
   </arg>

   <arg choice="plain" rep="repeat">
    <arg choice="opt">
     <group choice="plain">
      <arg choice="plain"><option>-i</option></arg>
      <arg choice="plain"><option>--index</option></arg>
     </group>
     <replaceable>index</replaceable>
    </arg>
   </arg>

   <arg choice="plain">
    <arg choice="opt">
     <group choice="plain">
      <arg choice="plain"><option>-s</option></arg>
      <arg choice="plain"><option>--system</option></arg>
     </group>
    </arg>
   </arg>

   <arg choice="opt">
    <group choice="plain">
     <arg choice="plain"><replaceable>dbname</replaceable></arg>
     <arg choice="plain"><option>-a</option></arg>
     <arg choice="plain"><option>--all</option></arg>
    </group>
   </arg>
  </cmdsynopsis>
 </refsynopsisdiv>


 <refsect1>
  <title>Description</title>

  <para>
   <application>reindexdb</application> is a utility for rebuilding indexes
   in a <productname>PostgreSQL</productname> database.
  </para>

  <para>
   <application>reindexdb</application> is a wrapper around the SQL
   command <link linkend="sql-reindex"><command>REINDEX</command></link>.
   There is no effective difference between reindexing databases via
   this utility and via other methods for accessing the server.
  </para>

 </refsect1>


 <refsect1>
  <title>Options</title>

   <para>
    <application>reindexdb</application> accepts the following command-line arguments:

    <variablelist>
     <varlistentry>
      <term><option>-a</option></term>
      <term><option>--all</option></term>
      <listitem>
       <para>
        Reindex all databases.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>--concurrently</option></term>
      <listitem>
       <para>
        Use the <literal>CONCURRENTLY</literal> option.  See
        <xref linkend="sql-reindex"/>, where all the caveats of this option
        are explained in detail.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option><optional>-d</optional> <replaceable class="parameter">dbname</replaceable></option></term>
      <term><option><optional>--dbname=</optional><replaceable class="parameter">dbname</replaceable></option></term>
      <listitem>
       <para>
        Specifies the name of the database to be reindexed,
        when <option>-a</option>/<option>--all</option> is not used.
        If this is not specified, the database name is read
        from the environment variable <envar>PGDATABASE</envar>.  If
        that is not set, the user name specified for the connection is
        used.  The <replaceable>dbname</replaceable> can be a <link
        linkend="libpq-connstring">connection string</link>.  If so,
        connection string parameters will override

Title: reindexdb: Reindex a PostgreSQL Database
Summary
reindexdb is a utility for rebuilding indexes in a PostgreSQL database. It is a wrapper around the SQL command REINDEX. The command accepts options to reindex all databases, use the CONCURRENTLY option, or specify a database name. If no database name is specified, it is read from the environment variable PGDATABASE or the user name specified for the connection.