doc: Explain 'invalid' index state for CREATE INDEX CONCURRENTLY
authorAlvaro Herrera
Fri, 20 May 2022 08:05:31 +0000 (10:05 +0200)
committerAlvaro Herrera
Fri, 20 May 2022 08:05:31 +0000 (10:05 +0200)
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 
Reported-by: Lauren Fliksteen
Reviewed-by: Rajakavitha Kodhandapani
Discussion: https://postgr.es/m/165290238488.670.7500177735573254738@wrigleys.postgresql.org

doc/src/sgml/ref/create_index.sgml

index cc484d5b3980aa30e7df0230f12a40b69ebbd584..11179f0b9d9d5cdb947b862af24fc068b1e2d75e 100644 (file)
@@ -606,7 +606,8 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] 
    
 
    
-    In a concurrent index build, the index is actually entered into
+    In a concurrent index build, the index is actually entered as an
+    invalid index into
     the system catalogs in one transaction, then two table scans occur in
     two more transactions.  Before each table scan, the index build must
     wait for existing transactions that have modified the table to terminate.
@@ -615,7 +616,7 @@ CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] 
     scan to terminate, including transactions used by any phase of concurrent
     index builds on other tables, if the indexes involved are partial or have
     columns that are not simple column references.
-    Then finally the index can be marked ready for use,
+    Then finally the index can be marked valid and ready for use,
     and the CREATE INDEX command terminates.
     Even then, however, the index may not be immediately usable for queries:
     in the worst case, it cannot be used as long as transactions exist that