model-writtenrun 7842 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that altering a partitioned table after dropping its tablespace crashes while reconstructing an index definition; Michael Paquier also demonstrated failed partition creation from a dangling tablespace reference and identified affected index support since PostgreSQL 11 and table support since PostgreSQL 12 #1 #2.
- Tom Lane explained that DROP TABLESPACE relies on physical files because it cannot inspect other databases' pg_class catalogs, and proposed either creating stub files for partitioned relations or removing their tablespace association #3.
- Alvaro Herrera initially considered restoring physical files and submitted null checks in ruleutils.c to prevent the immediate crash, but Tom Lane and Michael Paquier warned about upgrade complications and introducing storage behavior for partitioned relations #4 #5 #6.
- After the discussion stalled, Michael Paquier proposed removing partitioned-relation tablespace support for PostgreSQL 14; Alvaro Herrera opposed this, Tomas Vondra questioned whether it solved the problem, and Michael clarified that removing stored tablespace references would prevent dangling references #7 #8 #9 #10.
- Alvaro Herrera proposed protecting tablespaces through pg_shdepend; Michael Paquier welcomed avoiding physical files but initially doubted backpatchability, while Alvaro and Tom Lane concluded that missing entries could remain tolerated in existing installations, with Tom discouraging manual catalog edits #11 #12 #13 #14.
- Alvaro Herrera submitted a replacement implementation that records tablespace dependencies for relations without storage, updates them when tablespaces change, rejects dependent tablespace drops, and adds documentation and regression coverage #16.
- Michael Paquier suggested extending dependency tracking to relations with physical files and adding assertions restricting supported relation kinds; Alvaro Herrera declined both, citing unnecessary catalog growth and the intention to protect any storage-less relation with a tablespace, and Michael accepted those explanations #17 #18 #19 #20 #21.
- The replacement patch #16 landed unchanged as ebfe2dbd6b, superseding the initial crash-avoidance patch; the commit explains that existing partitioned relations receive no automatic dependency entries but can acquire protection by changing their tablespace away and back.
- The thread ended with Alvaro Herrera confirming the fix was pushed to PostgreSQL 11 through master, with no further revision pending in the discussion #22.