model-writtenrun 2085 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tushar reported an upgrade failure caused by adding a primary key to an inheritance parent without marking its existing child column NOT NULL in #1; Michael Paquier identified the missing propagation in #2, and Tom Lane supported enforcing inheritance consistency in #3.
- Michael submitted the propagation fix in #5, and Tom committed it as c30f1770a9 with revised comments and an unconditional recursion flag; #6 explains that it would ship in PostgreSQL 10 without backpatching because it changed behavior.
- Ali Akbar encountered another upgrade failure and demonstrated that DROP NOT NULL on a child could still create inconsistent metadata in #8, proposing a backend check and then resending the identical patch without terminal color escapes in #9.
- Amit Langote questioned redundant partition checks and lock release in #10, while Michael rejected the approach over locking hazards and the need to represent NOT NULL inheritance properly in #11; Ali consequently deferred backend prevention and proposed an upgrade pre-check in #12.
- Ali submitted the recursive pre-check in #14 and revised its wording in #17 after Justin Pryzby's corrections in #15 and Michael's review in #16, while rejecting a restriction to pre-10 source servers because child DROP NOT NULL remained possible.
- After nearly six years, Justin revived the forgotten pre-check following another costly upgrade failure in #18, then clarified in #20 that the failure occurred upgrading PostgreSQL 15 to 16 and was not confined to the old primary-key bug.
- Justin rebased and amended Ali's patch in #21, retaining Ali's authorship while adding handling for cataloged NOT NULL constraints and cleaning up reporting.
- Alvaro Herrera revived the work again in #22, replacing the recursive query with direct inheritance comparisons and adopting pg_upgrade's task infrastructure; he explained that PostgreSQL 18 prevented creation of the inconsistent state but older source clusters still needed checking.
- Justin advocated backpatching in #23, and Tom explained in #25 that the check remained useful both for upgrades to current releases and in older destination branches.
- Alvaro committed the pre-check as b0f0e2221f from #22, adapting the supplied commit's execution code to an explicit database loop, and announced the supported-branch landings in #27.
- After landing, Alvaro considered generating complete corrective ALTER TABLE commands and proposed broader diagnostic wording cleanup in #26; those follow-up ideas are not included in the supplied commits and have no recorded resolution in this thread.
- Buildfarm testing exposed the new query's dependence on regnamespace, unavailable before PostgreSQL 9.5, as Alvaro reported in #28; he supplied a pg_namespace-join replacement tested against PostgreSQL 9.2 in #29, and Tom verified compatibility back to 8.4 in #30.
- The compatibility patch landed as 708469281e from #29, and Alvaro confirmed in the final message #31 that it was pushed and the buildfarm failure was resolved.