Skip to content

Commit aa78357

Browse files
committed
doc: Explain 'invalid' index state for CREATE INDEX CONCURRENTLY
It wasn't previously mentioned that the index is created as invalid, which is confusing to new users. Backpatch to 14 (only because of a conflict in 13). Author: Laurenz Albe <laurenz.albe@cybertec.at> Reported-by: Lauren Fliksteen <dancernerd32@gmail.com> Reviewed-by: Rajakavitha Kodhandapani <krajakavitha@gmail.com> Discussion: https://postgr.es/m/165290238488.670.7500177735573254738@wrigleys.postgresql.org
1 parent 3a8d83c commit aa78357

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/src/sgml/ref/create_index.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
606606
</para>
607607

608608
<para>
609-
In a concurrent index build, the index is actually entered into
609+
In a concurrent index build, the index is actually entered as an
610+
<quote>invalid</quote> index into
610611
the system catalogs in one transaction, then two table scans occur in
611612
two more transactions. Before each table scan, the index build must
612613
wait for existing transactions that have modified the table to terminate.
@@ -615,7 +616,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] <replaceable class=
615616
scan to terminate, including transactions used by any phase of concurrent
616617
index builds on other tables, if the indexes involved are partial or have
617618
columns that are not simple column references.
618-
Then finally the index can be marked ready for use,
619+
Then finally the index can be marked <quote>valid</quote> and ready for use,
619620
and the <command>CREATE INDEX</command> command terminates.
620621
Even then, however, the index may not be immediately usable for queries:
621622
in the worst case, it cannot be used as long as transactions exist that

0 commit comments

Comments
 (0)