model-writtenrun 7278 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane opened the thread with an ATTACH PARTITION example in which a child's generated partition-key column changed an inserted value outside the partition's bounds, questioning whether generation-status mismatches should be allowed #1.
- Shortly afterward, 3f7836ff65 landed the related executor/planner fix developed in thread #47063 from #523826, credited to Amit Langote and Tom Lane; it calculated generated-column dependencies per relation, was backpatched through PostgreSQL 13, and left a possible PostgreSQL 12 trigger corner case unfixed.
- Amit Langote proposed rejecting every partition-only generated column, avoiding the need to inspect partition keys in more distant ancestors, and supplied the initial ATTACH PARTITION fix #2.
- Tom Lane demonstrated that traditional inheritance also allowed updates through a parent to overwrite a child's generated value, then extended the checks to inheritance and table creation; he ruled out backpatching because this removed documented behavior #3 #4.
- Amit Langote approved the broader patch and supplied a delta to make CREATE TABLE ... PARTITION OF use the same generation-status check and error, which Tom Lane initially accepted #5 #6.
- Further testing showed that the delta allowed partitions with different generation expressions, but dump restoration failed because ATTACH PARTITION still required matching expressions; Tom Lane proposed matching only generation status, and Amit Langote incorporated that rule and the delta into a consolidated patch #7 #8.
- Tom Lane committed the consolidated patch as 8bf6ec3ba3, adding child-expression overrides for conflicting multiple-inheritance parents, pg_dump support, and expanded tests and documentation #9.
- Amit Langote caught ADD PARTITION in the new documentation and submitted the ATTACH PARTITION correction, which landed unchanged as d93d68aeea #10 #11.
- A month later, Alexander Lakhin reported that specifying a DEFAULT for an inherited generated partition column triggered an assertion, or silently overrode generation without assertions; Alvaro Herrera said the command should fail, and Tom Lane agreed that a check was missing #12 #13 #14.
- The last message promised the remaining fix, and the supplied subsequent commit a0fa18cc0d fulfilled that promise by adding full conflict checks and regression tests, leaving no attached patch outstanding #14.