model-writtenrun 6099 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andres Freund reported that removing the policy-violating postgres.h inclusion from relcache.h broke pg_upgrade because visibilitymap.h indirectly exposed a Datum declaration, initially suggesting an explicit backend-header inclusion in pg_upgrade/file.c #1.
- Tom Lane questioned the header dependencies, and Andres identified two alternatives: split visibility-map definitions from backend declarations or forward-declare Relation; Tom considered both viable, and they also discussed detecting redundant core-header inclusions #2 #3 #4.
- Alexander Korotkov proposed splitting out the macros, while Andres supplied a competing forward-declaration patch and suggested naming the separate header visibilitymapdefs.h; Alexander retained the split and adopted that name in his revised attachment #6 #7 #8.
- Alvaro Herrera requested that function-dependent VM_ALL_VISIBLE and VM_ALL_FROZEN remain in visibilitymap.h and identified description and copyright corrections; Alexander incorporated all of these changes in the final patch #9 #10.
- Andres approved the final patch and asked about backpatching, which Alexander confirmed; Tom requested waiting until PostgreSQL 14rc1 was tagged, and Alexander agreed in the thread's final message #11 #12 #13 #14.
- Alexander subsequently committed #10 with an identical code diff as b92f9f7443, with backports through PostgreSQL 13; the forward-declaration alternative was not adopted, and redundant-header diagnostics remained outside this patch.