~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/reindexdb.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--
 
2
doc/src/sgml/ref/reindexdb.sgml
 
3
PostgreSQL documentation
 
4
-->
 
5
 
 
6
<refentry id="APP-REINDEXDB">
 
7
 <refmeta>
 
8
  <refentrytitle><application>reindexdb</application></refentrytitle>
 
9
  <manvolnum>1</manvolnum>
 
10
  <refmiscinfo>Application</refmiscinfo>
 
11
 </refmeta>
 
12
 
 
13
 <refnamediv>
 
14
  <refname id="reindexdb">reindexdb</refname>
 
15
  <refpurpose>reindex a <productname>PostgreSQL</productname> database</refpurpose>
 
16
 </refnamediv>
 
17
 
 
18
 <indexterm zone="app-reindexdb">
 
19
  <primary>reindexdb</primary>
 
20
 </indexterm>
 
21
 
 
22
 <refsynopsisdiv>
 
23
  <cmdsynopsis>
 
24
   <command>reindexdb</command>
 
25
   <arg rep="repeat"><replaceable>connection-option</replaceable></arg>
 
26
   <arg>--table | -t <replaceable>table</replaceable> </arg>
 
27
   <arg>--index | -i <replaceable>index</replaceable> </arg>
 
28
   <arg><replaceable>dbname</replaceable></arg>
 
29
  </cmdsynopsis>
 
30
 
 
31
  <cmdsynopsis>
 
32
   <command>reindexdb</command>
 
33
   <arg rep="repeat"><replaceable>connection-option</replaceable></arg>
 
34
   <arg>--all | -a</arg>
 
35
  </cmdsynopsis>
 
36
 
 
37
  <cmdsynopsis>
 
38
   <command>reindexdb</command>
 
39
   <arg rep="repeat"><replaceable>connection-option</replaceable></arg>
 
40
   <arg>--system | -s</arg>
 
41
   <arg><replaceable>dbname</replaceable></arg>
 
42
  </cmdsynopsis>
 
43
 </refsynopsisdiv>
 
44
 
 
45
 
 
46
 <refsect1>
 
47
  <title>Description</title>
 
48
 
 
49
  <para>
 
50
   <application>reindexdb</application> is a utility for rebuilding indexes
 
51
   in a <productname>PostgreSQL</productname> database.
 
52
  </para>
 
53
 
 
54
  <para>
 
55
   <application>reindexdb</application> is a wrapper around the SQL
 
56
   command <xref linkend="SQL-REINDEX">.
 
57
   There is no effective difference between reindexing databases via
 
58
   this utility and via other methods for accessing the server.
 
59
  </para>
 
60
 
 
61
 </refsect1>
 
62
 
 
63
 
 
64
 <refsect1>
 
65
  <title>Options</title>
 
66
 
 
67
   <para>
 
68
    <application>reindexdb</application> accepts the following command-line arguments:
 
69
 
 
70
    <variablelist>
 
71
     <varlistentry>
 
72
      <term><option>-a</></term>
 
73
      <term><option>--all</></term>
 
74
      <listitem>
 
75
       <para>
 
76
        Reindex all databases.
 
77
       </para>
 
78
      </listitem>
 
79
     </varlistentry>
 
80
 
 
81
     <varlistentry>
 
82
      <term><option><optional>-d</> <replaceable class="parameter">dbname</replaceable></></term>
 
83
      <term><option><optional>--dbname=</><replaceable class="parameter">dbname</replaceable></></term>
 
84
      <listitem>
 
85
       <para>
 
86
        Specifies the name of the database to be reindexed.
 
87
        If this is not specified and <option>-a</option> (or
 
88
        <option>--all</option>) is not used, the database name is read
 
89
        from the environment variable <envar>PGDATABASE</envar>.  If
 
90
        that is not set, the user name specified for the connection is
 
91
        used.
 
92
       </para>
 
93
      </listitem>
 
94
     </varlistentry>
 
95
 
 
96
     <varlistentry>
 
97
      <term><option>-e</></term>
 
98
      <term><option>--echo</></term>
 
99
      <listitem>
 
100
       <para>
 
101
        Echo the commands that <application>reindexdb</application> generates
 
102
        and sends to the server.
 
103
       </para>
 
104
      </listitem>
 
105
     </varlistentry>
 
106
 
 
107
     <varlistentry>
 
108
      <term><option>-i <replaceable class="parameter">index</replaceable></></term>
 
109
      <term><option>--index=<replaceable class="parameter">index</replaceable></></term>
 
110
      <listitem>
 
111
       <para>
 
112
        Recreate <replaceable class="parameter">index</replaceable> only.
 
113
       </para>
 
114
      </listitem>
 
115
     </varlistentry>
 
116
 
 
117
     <varlistentry>
 
118
      <term><option>-q</></term>
 
119
      <term><option>--quiet</></term>
 
120
      <listitem>
 
121
       <para>
 
122
        Do not display progress messages.
 
123
       </para>
 
124
      </listitem>
 
125
     </varlistentry>
 
126
 
 
127
     <varlistentry>
 
128
      <term><option>-s</></term>
 
129
      <term><option>--system</></term>
 
130
      <listitem>
 
131
       <para>
 
132
        Reindex database's system catalogs.
 
133
       </para>
 
134
      </listitem>
 
135
     </varlistentry>
 
136
 
 
137
     <varlistentry>
 
138
      <term><option>-t <replaceable class="parameter">table</replaceable></></term>
 
139
      <term><option>--table=<replaceable class="parameter">table</replaceable></></term>
 
140
      <listitem>
 
141
       <para>
 
142
        Reindex <replaceable class="parameter">table</replaceable> only.
 
143
       </para>
 
144
      </listitem>
 
145
     </varlistentry>
 
146
 
 
147
    <varlistentry>
 
148
      <term><option>-V</></term>
 
149
      <term><option>--version</></term>
 
150
      <listitem>
 
151
       <para>
 
152
       Print the <application>reindexdb</application> version and exit.
 
153
       </para>
 
154
      </listitem>
 
155
    </varlistentry>
 
156
 
 
157
    <varlistentry>
 
158
      <term><option>-?</></term>
 
159
      <term><option>--help</></term>
 
160
      <listitem>
 
161
      <para>
 
162
      Show help about <application>reindexdb</application> command line
 
163
      arguments, and exit.
 
164
      </para>
 
165
      </listitem>
 
166
    </varlistentry>
 
167
 
 
168
   </variablelist>
 
169
 
 
170
   </para>
 
171
 
 
172
   <para>
 
173
    <application>reindexdb</application> also accepts
 
174
    the following command-line arguments for connection parameters:
 
175
 
 
176
    <variablelist>
 
177
     <varlistentry>
 
178
      <term><option>-h <replaceable class="parameter">host</replaceable></></term>
 
179
      <term><option>--host=<replaceable class="parameter">host</replaceable></></term>
 
180
      <listitem>
 
181
       <para>
 
182
        Specifies the host name of the machine on which the server is
 
183
        running.  If the value begins with a slash, it is used as the
 
184
        directory for the Unix domain socket.
 
185
       </para>
 
186
      </listitem>
 
187
     </varlistentry>
 
188
 
 
189
     <varlistentry>
 
190
      <term><option>-p <replaceable class="parameter">port</replaceable></></term>
 
191
      <term><option>--port=<replaceable class="parameter">port</replaceable></></term>
 
192
      <listitem>
 
193
       <para>
 
194
        Specifies the TCP port or local Unix domain socket file
 
195
        extension on which the server
 
196
        is listening for connections.
 
197
       </para>
 
198
      </listitem>
 
199
     </varlistentry>
 
200
 
 
201
     <varlistentry>
 
202
      <term><option>-U <replaceable class="parameter">username</replaceable></></term>
 
203
      <term><option>--username=<replaceable class="parameter">username</replaceable></></term>
 
204
      <listitem>
 
205
       <para>
 
206
        User name to connect as.
 
207
       </para>
 
208
      </listitem>
 
209
     </varlistentry>
 
210
 
 
211
     <varlistentry>
 
212
      <term><option>-w</></term>
 
213
      <term><option>--no-password</></term>
 
214
      <listitem>
 
215
       <para>
 
216
        Never issue a password prompt.  If the server requires
 
217
        password authentication and a password is not available by
 
218
        other means such as a <filename>.pgpass</filename> file, the
 
219
        connection attempt will fail.  This option can be useful in
 
220
        batch jobs and scripts where no user is present to enter a
 
221
        password.
 
222
       </para>
 
223
      </listitem>
 
224
     </varlistentry>
 
225
 
 
226
     <varlistentry>
 
227
      <term><option>-W</></term>
 
228
      <term><option>--password</></term>
 
229
      <listitem>
 
230
       <para>
 
231
        Force <application>reindexdb</application> to prompt for a
 
232
        password before connecting to a database.
 
233
       </para>
 
234
 
 
235
       <para>
 
236
        This option is never essential, since
 
237
        <application>reindexdb</application> will automatically prompt
 
238
        for a password if the server demands password authentication.
 
239
        However, <application>reindexdb</application> will waste a
 
240
        connection attempt finding out that the server wants a password.
 
241
        In some cases it is worth typing <option>-W</> to avoid the extra
 
242
        connection attempt.
 
243
       </para>
 
244
      </listitem>
 
245
     </varlistentry>
 
246
    </variablelist>
 
247
   </para>
 
248
 </refsect1>
 
249
 
 
250
 
 
251
 <refsect1>
 
252
  <title>Environment</title>
 
253
 
 
254
  <variablelist>
 
255
   <varlistentry>
 
256
    <term><envar>PGDATABASE</envar></term>
 
257
    <term><envar>PGHOST</envar></term>
 
258
    <term><envar>PGPORT</envar></term>
 
259
    <term><envar>PGUSER</envar></term>
 
260
 
 
261
    <listitem>
 
262
     <para>
 
263
      Default connection parameters
 
264
     </para>
 
265
    </listitem>
 
266
   </varlistentry>
 
267
  </variablelist>
 
268
 
 
269
  <para>
 
270
   This utility, like most other <productname>PostgreSQL</> utilities,
 
271
   also uses the environment variables supported by <application>libpq</>
 
272
   (see <xref linkend="libpq-envars">).
 
273
  </para>
 
274
 
 
275
 </refsect1>
 
276
 
 
277
 
 
278
 <refsect1>
 
279
  <title>Diagnostics</title>
 
280
 
 
281
  <para>
 
282
   In case of difficulty, see <xref linkend="SQL-REINDEX">
 
283
   and <xref linkend="APP-PSQL"> for
 
284
   discussions of potential problems and error messages.
 
285
   The database server must be running at the
 
286
   targeted host.  Also, any default connection settings and environment
 
287
   variables used by the <application>libpq</application> front-end
 
288
   library will apply.
 
289
  </para>
 
290
 
 
291
 </refsect1>
 
292
 
 
293
 
 
294
 <refsect1>
 
295
  <title>Notes</title>
 
296
 
 
297
  <para>
 
298
   <application>reindexdb</application> might need to connect several
 
299
   times to the <productname>PostgreSQL</productname> server, asking
 
300
   for a password each time. It is convenient to have a
 
301
   <filename>~/.pgpass</> file in such cases. See <xref
 
302
   linkend="libpq-pgpass"> for more information.
 
303
  </para>
 
304
 </refsect1>
 
305
 
 
306
 
 
307
 <refsect1>
 
308
  <title>Examples</title>
 
309
 
 
310
   <para>
 
311
    To reindex the database <literal>test</literal>:
 
312
<screen>
 
313
<prompt>$ </prompt><userinput>reindexdb test</userinput>
 
314
</screen>
 
315
   </para>
 
316
 
 
317
   <para>
 
318
    To reindex the table <literal>foo</literal> and the index
 
319
    <literal>bar</literal> in a database named <literal>abcd</literal>:
 
320
<screen>
 
321
<prompt>$ </prompt><userinput>reindexdb --table foo --index bar abcd</userinput>
 
322
</screen>
 
323
   </para>
 
324
 
 
325
 </refsect1>
 
326
 
 
327
 <refsect1>
 
328
  <title>See Also</title>
 
329
 
 
330
  <simplelist type="inline">
 
331
   <member><xref linkend="sql-reindex"></member>
 
332
  </simplelist>
 
333
 </refsect1>
 
334
 
 
335
</refentry>