model-writtenrun 8837 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Manuel Rigger reported that REINDEX CONCURRENTLY failed on a temporary table with ON COMMIT DELETE ROWS in #1; Jeff Janes reproduced it on PostgreSQL 12 in #2, and Andres Freund traced it to internal transactions executing ON COMMIT actions and reproduced the corresponding CREATE INDEX failure in #3.
- After initially considering rejection, Andres Freund proposed silently using non-concurrent indexing for temporary tables in #5, Tom Lane supported avoiding extra application complexity in #6 and #8, and Michael Paquier accepted applying that behavior to all temporary tables in #11.
- Michael Paquier posted the first implementation in #12, covering CREATE INDEX and all REINDEX variants, and reported that the fallback also avoided a crash when attempting to reindex another session's temporary relation.
- Andres Freund's reviews in #14 and #19 led Michael Paquier to extend the fix to DROP INDEX, centralize persistence checks, add transaction-block tests, and improve documentation in #15 and #21; Álvaro Herrera's naming review in #18 also shaped the helper.
- Heikki Linnakangas questioned the helper's abstraction and the timing of lock selection in #23; Michael Paquier then moved concurrency decisions earlier and added stronger initial locking for temporary relations in #25.
- Heikki Linnakangas argued that the extra lock machinery was unnecessary because other sessions cannot access these temporary tables in #27, leading Michael Paquier to remove the RangeVar locking changes while retaining other improvements in #28.
- Heikki Linnakangas supplied a full revision in #29 that replaced the helper with direct persistence checks, avoided modifying IndexStmt, and handled the DROP INDEX fallback inside index_drop().
- Michael Paquier combined Heikki Linnakangas's revision with an earlier DROP INDEX decision in RemoveRelations() in #31, explaining in #30 that waiting until index_drop() left unnecessary concurrent-deletion machinery active; the additional CheckTableNotInUse() check was deferred to a separate patch and thread.
- Michael Paquier committed a904abe2e2 from #31, additionally correcting CREATE INDEX's lock selection, making the schema regression test exercise CONCURRENTLY, and fixing a comment typo; his final message #32 confirmed backpatching through PostgreSQL 9.4, completing the temporary-table fix while leaving the separate defensive check outside this change.