model-writtenrun 256 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Matthias van de Meent reported that overflowing pg_class.relchecks could make tables undroppable and supplied a backpatch-safe limit-enforcement patch in #1, while mentioning removal or replacement of the catalog field as alternatives.
- Sivaprasad corrected the comparisons to permit exactly 32,767 CHECK constraints in #2, and Michael Paquier supported backpatching the fix in #3.
- Bertrand Drouvot requested an explicit program-limit error code and overflow checks before storing constraints in #4; Jian He proposed pg_add_s16_overflow() in #5, and Michael Paquier endorsed these changes in #6.
- Matthias incorporated the review in #7, changing local counters to int16, using checked addition, and rejecting overflow before StoreRelCheck() while retaining the SetRelationNumChecks() signature and defensive validation.
- Michael Paquier applied #7 with only comment whitespace reflow as 5e59290402, backpatched through PostgreSQL 14, and confirmed completion in #8; repairing already-overflowed catalog values remained outside the patch's scope, as stated in #1.