summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-07-19 11:45:06 +0900
committerMichael Paquier <michael@paquier.xyz>2022-07-19 11:45:06 +0900
commit2cbc3c17a5c11d13c0ac92fe7557c56408f8f3d0 (patch)
tree835b1a5f656c1bb7ec6439e9ef66532b1f1670e8 /doc/src
parent5fb5b6c4c176d873bd8405ec40f7002daf242a36 (diff)
Rework logic and simplify syntax of REINDEX DATABASE/SYSTEM
Per discussion, this commit includes a couple of changes to these two flavors of REINDEX: * The grammar is changed to make the name of the object optional, hence one can rebuild all the indexes of the wanted area by specifying only "REINDEX DATABASE;" or "REINDEX SYSTEM;". Previously, the object name was mandatory and had to match the name of the database on which the command is issued. * REINDEX DATABASE is changed to ignore catalogs, making this task only possible with REINDEX SYSTEM. This is a historical change, but there was no way to work only on the indexes of a database without touching the catalogs. We have discussed more approaches here, like the addition of an option to skip the catalogs without changing the original behavior, but concluded that what we have here is for the best. This builds on top of the TAP tests introduced in 5fb5b6c, showing the change in behavior for REINDEX SYSTEM. reindexdb is updated so as we do not issue an extra REINDEX SYSTEM when working on a database in the non-concurrent case, something that was confusing when --concurrently got introduced, so this simplifies the code. Author: Simon Riggs Reviewed-by: Ashutosh Bapat, Bernd Helmle, Álvaro Herrera, Cary Huang, Michael Paquier Discussion: https://postgr.es/m/CANbhV-H=NH6Om4-X6cRjDWfH_Mu1usqwkuYVp-hwdB_PSHWRfg@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/reindex.sgml12
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/src/sgml/ref/reindex.sgml b/doc/src/sgml/ref/reindex.sgml
index 336ca24b312..fcbda881494 100644
--- a/doc/src/sgml/ref/reindex.sgml
+++ b/doc/src/sgml/ref/reindex.sgml
@@ -21,7 +21,8 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
-REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { INDEX | TABLE | SCHEMA | DATABASE | SYSTEM } [ CONCURRENTLY ] <replaceable class="parameter">name</replaceable>
+REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { INDEX | TABLE | SCHEMA } [ CONCURRENTLY ] <replaceable class="parameter">name</replaceable>
+REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { DATABASE | SYSTEM } [ CONCURRENTLY ] [ <replaceable class="parameter">name</replaceable> ]
<phrase>where <replaceable class="parameter">option</replaceable> can be one of:</phrase>
@@ -126,8 +127,9 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
<term><literal>DATABASE</literal></term>
<listitem>
<para>
- Recreate all indexes within the current database.
- Indexes on shared system catalogs are also processed.
+ Recreate all indexes within the current database, except system
+ catalogs.
+ Indexes on shared system catalogs are not processed.
This form of <command>REINDEX</command> cannot be executed inside a
transaction block.
</para>
@@ -154,8 +156,8 @@ REINDEX [ ( <replaceable class="parameter">option</replaceable> [, ...] ) ] { IN
The name of the specific index, table, or database to be
reindexed. Index and table names can be schema-qualified.
Presently, <command>REINDEX DATABASE</command> and <command>REINDEX SYSTEM</command>
- can only reindex the current database, so their parameter must match
- the current database's name.
+ can only reindex the current database. Their parameter is optional,
+ and it must match the current database's name.
</para>
</listitem>
</varlistentry>