1REINDEXDB(1) PostgreSQL 9.2.24 Documentation REINDEXDB(1)
2
3
4
6 reindexdb - reindex a PostgreSQL database
7
9 reindexdb [connection-option...] [--table | -t table] [--index | -i
10 index] [dbname]
11
12 reindexdb [connection-option...] --all | -a
13
14 reindexdb [connection-option...] --system | -s [dbname]
15
17 reindexdb is a utility for rebuilding indexes in a PostgreSQL database.
18
19 reindexdb is a wrapper around the SQL command REINDEX(7). There is no
20 effective difference between reindexing databases via this utility and
21 via other methods for accessing the server.
22
24 reindexdb accepts the following command-line arguments:
25
26 -a, --all
27 Reindex all databases.
28
29 [-d] dbname, [--dbname=]dbname
30 Specifies the name of the database to be reindexed. If this is not
31 specified and -a (or --all) is not used, the database name is read
32 from the environment variable PGDATABASE. If that is not set, the
33 user name specified for the connection is used.
34
35 -e, --echo
36 Echo the commands that reindexdb generates and sends to the server.
37
38 -i index, --index=index
39 Recreate index only.
40
41 -q, --quiet
42 Do not display progress messages.
43
44 -s, --system
45 Reindex database's system catalogs.
46
47 -t table, --table=table
48 Reindex table only.
49
50 -V, --version
51 Print the reindexdb version and exit.
52
53 -?, --help
54 Show help about reindexdb command line arguments, and exit.
55
56 reindexdb also accepts the following command-line arguments for
57 connection parameters:
58
59 -h host, --host=host
60 Specifies the host name of the machine on which the server is
61 running. If the value begins with a slash, it is used as the
62 directory for the Unix domain socket.
63
64 -p port, --port=port
65 Specifies the TCP port or local Unix domain socket file extension
66 on which the server is listening for connections.
67
68 -U username, --username=username
69 User name to connect as.
70
71 -w, --no-password
72 Never issue a password prompt. If the server requires password
73 authentication and a password is not available by other means such
74 as a .pgpass file, the connection attempt will fail. This option
75 can be useful in batch jobs and scripts where no user is present to
76 enter a password.
77
78 -W, --password
79 Force reindexdb to prompt for a password before connecting to a
80 database.
81
82 This option is never essential, since reindexdb will automatically
83 prompt for a password if the server demands password
84 authentication. However, reindexdb will waste a connection attempt
85 finding out that the server wants a password. In some cases it is
86 worth typing -W to avoid the extra connection attempt.
87
88 --maintenance-db=dbname
89 Specifies the name of the database to connect to discover what
90 other databases should be reindexed. If not specified, the postgres
91 database will be used, and if that does not exist, template1 will
92 be used.
93
95 PGDATABASE, PGHOST, PGPORT, PGUSER
96 Default connection parameters
97
98 This utility, like most other PostgreSQL utilities, also uses the
99 environment variables supported by libpq (see Section 31.14,
100 “Environment Variables”, in the documentation).
101
103 In case of difficulty, see REINDEX(7) and psql(1) for discussions of
104 potential problems and error messages. The database server must be
105 running at the targeted host. Also, any default connection settings and
106 environment variables used by the libpq front-end library will apply.
107
109 reindexdb might need to connect several times to the PostgreSQL server,
110 asking for a password each time. It is convenient to have a ~/.pgpass
111 file in such cases. See Section 31.15, “The Password File”, in the
112 documentation for more information.
113
115 To reindex the database test:
116
117 $ reindexdb test
118
119 To reindex the table foo and the index bar in a database named abcd:
120
121 $ reindexdb --table foo --index bar abcd
122
124 REINDEX(7)
125
126
127
128PostgreSQL 9.2.24 2017-11-06 REINDEXDB(1)