Re: BUG #18016: REINDEX TABLE failure - Mailing list pgsql-bugs

From Nathan Bossart
Subject Re: BUG #18016: REINDEX TABLE failure
Date
Msg-id 20230726201651.GC3310393@nathanxps13
Whole thread Raw
In response to BUG #18016: REINDEX TABLE failure  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Mon, Jul 10, 2023 at 09:35:05AM -0700, Gurjeet Singh wrote:
> The code block movement involved slightly more thought and care than I
> had previously imagined. As explained in comments in the patch, the
> enumeration and suppression of indexes on the main table must happen
> before any CommandCounterIncrement() call, hence the
> reindex-the-toast-table-if-any code had to be placed after that
> enumeration.

Do we need to add another CCI after reindexing the TOAST table?  It looks
like we presently do so between reindexing each relation, including the
TOAST table.

+     * This should be done after the suppression of the use of indexes (above),
+     * because the recursive call to reindex_relation() below will invoke
+     * CommandCounterIncrement(), which may prevent enumeration of the indexes
+     * on the table.

I'm not following this.  We've already obtained the list of index OIDs
before this point.  Does this create problems when we try to open and lock
the relations?  And if so, how?

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-bugs by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: Documentation bug at: current/sql-vacuum.html, Notes
Next
From: Gurjeet Singh
Date:
Subject: Fwd: BUG #18016: REINDEX TABLE failure