Re: REINDEX CONCURRENTLY unexpectedly fails
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, Manuel Rigger <rigger.manuel@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-12-12T20:11:08Z
Lists: pgsql-bugs
On 2019-Nov-20, Michael Paquier wrote: > diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h > index 1113d25b2d..04d3d4826f 100644 > --- a/src/include/catalog/index.h > +++ b/src/include/catalog/index.h > @@ -113,6 +113,8 @@ extern bool CompareIndexInfo(IndexInfo *info1, IndexInfo *info2, > > extern void BuildSpeculativeIndexInfo(Relation index, IndexInfo *ii); > > +extern bool RelationSupportsConcurrently(char relpersistence); > + > extern void FormIndexDatum(IndexInfo *indexInfo, > TupleTableSlot *slot, > EState *estate, I liked Andres' original naming suggestion better FWIW. With this, one wonders "concurrently what?" > +/* > + * RelationSupportsConcurrently > + * > + * Check if a relation supports concurrent builds or not. This is > + * used as a sanity check prior processing CREATE INDEX, DROP INDEX > + * or REINDEX when using CONCURRENTLY. > + */ Some suggestions, "RelationSupportsConcurrentIndexing" or "IndexSupportsConcurrently". Maybe replace the "ing" in the first or "ly" in the second with "DDL" or "Ops". (Also, if it's just about indexes and appears in index.h, why did you use the prefix "Relation"?) In the indexcmds.c Reindex* routines, why not turn off the "concurrent" flag? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Fix concurrent indexing operations with temporary tables
- d76652edc56f 9.4.26 landed
- c39f45598177 9.5.21 landed
- ef33edeb5835 9.6.17 landed
- 9055344b495f 10.12 landed
- 5b4b07fa9ac3 11.7 landed
- 817a1b88ac66 12.2 landed
- a904abe2e284 13.0 landed