model-writtenrun 328 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Nathan Bossart reported that dropping an explicitly selected replica identity index lets concurrent REPACK start but fail when decoding a concurrent DELETE; Matthias van de Meent traced this to REPACK's primary-key fallback and supplied a patch using RelationGetReplicaIndex() #1 #2.
- Chao Li proposed preventing the stale catalog state by rejecting DROP INDEX on an explicitly selected replica identity index, supplying a separate implementation and regression tests #3.
- Ewan Young found that Matthias's rearranged check wrongly rejected explicit replica identity indexes without primary keys and lost the intended deferrable-key diagnostic; his revision retained the original error structure and passed all three reported cases, while his testing also showed that Chao's guard missed constraint-driven index deletion #4.
- Antonin Houska observed that dump and restore reset the missing-index state to DEFAULT, while Alvaro Herrera supported preventing index deletion but argued that the guard belonged in index_drop() to cover indirect deletion paths #5 #6.
- Alvaro Herrera then supplied an alternative that reset replica identity to DEFAULT when its index was dropped; Antonin Houska and Chao Li preferred an error to silently changing replication behavior, and Antonin demonstrated that missing identity can already prevent DELETE on the publisher #7 #8 #9 #10.
- Alvaro Herrera concluded that rejecting deletion in index_drop() also obstructed DROP TABLE and temporary index removal during ALTER TABLE SET DATA TYPE, making a comprehensive solution too invasive for the release, and returned to the original REPACK fix as revised by Ewan Young #11.
- Alvaro Herrera committed 434bde9ce6 from #4 with comment changes and a regression test, confirming reproduction and successful isolation testing; the immediate REPACK fix landed, while primary-key fallback, automatic DEFAULT restoration, and rejecting index deletion remained possible PostgreSQL 20 work #12.