Hi, This is my first attempt at contributing to the documentation of PostgreSQL. Here's the patch. Please let me know if any other changes need to be made.
Regards, Rajie On Thu, May 19, 2022 at 1:10 AM PG Doc comments form <nore...@postgresql.org> wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/14/sql-createindex.html > Description: > > I think the INVALID index can use further explanation, in particular, from > my experience it seems like when building an index concurrently, the index > gets inserted and labeled invalid while the index is being built, and then > the label gets removed if it finishes successfully or gets left on the > index > if there is a failure while building the index. It is my current > understanding, after experimenting, that INVALID means 'incomplete', > whether > that's because it's in progress or because it was unable to be completed, > but prior to my experiment my understanding was that INVALID indicated > failure. > > This was especially confusing when we were adding an index to a very large > table because we assumed the INVALID index indicated failure when we > couldn't find any other sign of progress or failure. >
{\rtf1\ansi\ansicpg1252\cocoartf2636 \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;\f1\fnil\fcharset0 Menlo-Bold;} {\colortbl;\red255\green255\blue255;\red159\green160\blue28;\red46\green174\blue187;\red47\green180\blue29; \red0\green0\blue0;\red180\green36\blue25;} {\*\expandedcolortbl;;\cssrgb\c68469\c68012\c14211;\cssrgb\c20199\c73241\c78251;\cssrgb\c20241\c73898\c14950; \csgray\c0;\cssrgb\c76411\c21697\c12527;} \paperw11900\paperh16840\margl1440\margr1440\vieww16300\viewh8400\viewkind0 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 \f0\fs22 \cf2 \CocoaLigature0 commit 0929611f11a3d326383204337359efef1cfed964 ( \f1\b \cf3 HEAD -> \cf4 update-index \f0\b0 \cf2 )\cf5 \ Author: Rajakavitha1 <krajakavi...@gmail.com>\ Date: Thu May 19 18:33:04 2022 +0530\ \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 \f1\b diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml \f0\b0 \ \f1\b index d3102a87d9..709039c0f8 100644 \f0\b0 \ \f1\b --- a/doc/src/sgml/ref/create_index.sgml \f0\b0 \ \f1\b +++ b/doc/src/sgml/ref/create_index.sgml \f0\b0 \ \cf3 @@ -665,11 +665,14 @@\cf5 Indexes:\ <para>\ Another caveat when building a unique index concurrently is that the\ uniqueness constraint is already being enforced against other transactions\ \cf6 - when the second table scan begins. This means that constraint violations\cf5 \ \cf4 + when the second table scan begins. This means that constraint violations\cf5 \ could be reported in other queries prior to the index becoming available\ \cf6 - for use, or even in cases where the index build eventually fails. Also,\cf5 \ \cf6 - if a failure does occur in the second scan, the <quote>invalid</quote> index\cf5 \ \cf6 - continues to enforce its uniqueness constraint afterwards.\cf5 \ \cf4 + for use, or even in cases where the index build eventually fails. The index\cf5 \ \cf4 + is inserted and labeled <quote>invalid</quote> while the index is being built,\cf5 \ \cf4 + and then the label is removed if the index builds successfully. If the index does\cf5 \ \cf4 + not build successfully, then the label <quote>invalid</quote> remains. Also, if a\cf5 \ }