model-writtenrun 2312 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jian he reported that pg_dump --if-exists --clean emitted a forbidden DROP for an attached child index, and Pavel Stehule agreed this was a bug while initially suggesting missing detach handling #1 #2.
- Jian submitted a patch suppressing child-index DROP statements and reported testing PostgreSQL 11 and master; Pavel questioned restore idempotence, then acknowledged implicit removal could work while asking why pg_dump explicitly drops indexes #3 #4 #5 #6.
- Tom Lane initially opposed the suppression approach and investigated giving INDEX ATTACH a corresponding detach operation, but found that ALTER INDEX DETACH PARTITION does not exist #7.
- Tom proposed reversing index dependencies to drop parent indexes first, but recognized that this still failed with --clean alone because the child index was already gone; adding unconditional IF EXISTS also raised compatibility concerns with older pg_restore versions #8.
- Jian explained that partition dependencies guarantee child-index removal when the parent index is dropped, and that post-data-only dumps explain the need for explicit index DROP statements generally #9.
- Tom accepted that backend restrictions made Jian's original approach the best available fix despite a selective-restore corner case, and committed it with expanded comments as 6a3e57865f; his final message confirmed the fix had landed, leaving the dependency-reversal alternative unused #3 #10.