model-writtenrun 9488 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- David Rowley reported that dump/restore moved partitions into their parent's tablespace and proposed creating each table independently before attaching it; his first patch also preserved partition column order and reused the binary-upgrade approach #1 #3.
- Andres Freund questioned whether the catalog distinguished an explicit tablespace choice from default_tablespace, and David confirmed that normalization to zero also lost explicit database-default choices for partitioned indexes #8 #9 #10.
- After a month, Alvaro Herrera took over the investigation, rebasing David's patch, adjusting attachment placement, and correcting pg_dump test expectations #11.
- Alvaro tried storing explicit database-default OIDs and emitting TABLESPACE clauses, but rejected his own experiment because it mishandled empty tablespaces and undermined portable restores into databases lacking the original tablespaces #13.
- Testing exposed a separate problem in ALTER TABLE index reconstruction: deparsed index definitions changed tablespace state; Alvaro first proposed a ruleutils adjustment, then identified the need to isolate default_tablespace changes to rebuilt indexes rather than newly added constraints #19 #20 #21.
- Alvaro combined the fixes into a broad patch using reset_default_tblspc flags, temporary GUC resets, special catalog handling for partitioned relations, psql display support, and regression tests #22.
- David offered an alternative that removed database-tablespace normalization for all relations, but Tom Lane explained that this would break CREATE DATABASE with a different tablespace, leaving that alternative unadopted #23 #24 #26.
- Alvaro continued his earlier implementation as three patches and added SET TABLESPACE DEFAULT syntax; Tom challenged the catalog exception and precedence rules, while the next revision corrected regression coverage #32 #33 #34.
- The next submission omitted the separate psql component and changed partitioned-table creation to ignore default_tablespace, implementing Andres's earlier request that only explicit or inherited choices persist for future partitions #35.
- Robert Haas demonstrated that retaining a concrete database-default OID could send existing and future partitions to different tablespaces after database relocation, prompting Alvaro to propose rejecting that explicit choice instead #36 #37.
- Tom and Andres favored removing tablespace inheritance, while Robert outlined the catalog representation and SQL syntax a complete solution would require; Alvaro instead pursued a narrower fix compatible with the existing representation #38 #39 #45 #52.
- Discussion with Amit Langote established that preserving partition column order was independently valuable despite possible tuple-conversion costs, while David clarified that ordinary dumps would still eliminate dropped-column holes #46 #48 #50 #51 #55.
- Alvaro separated the backpatchable pg_dump correction from the PostgreSQL 12 backend changes, restored default_tablespace's role in creating partitioned relations, and deferred a richer representation of explicit database-default inheritance to future development #52 #54.
- The pg_dump component of #35 landed as 3b23552ad8, credited to David Rowley, with light comment and output-construction edits and backports through PostgreSQL 10.
- Alvaro's final backend patch retained the index-rebuild fix but rejected explicit database-default tablespaces for partitioned relations, dropping the earlier catalog exception and new reset syntax #56.
- The backend patch landed as 87259588d0 with restored regression tests, documentation, and a catalog-version bump; Alvaro's final message confirmed that the narrowed fixes had been pushed #57.
- Subsequently, failures involving inherited NOT NULL and CHECK constraints caused the original pg_dump change to be reverted; 33a53130a8 records that history and reinstates the change with fixes from the later submission #426920 in thread #40544.