Mar - Apr 2025

5 commits
Add support for NOT ENFORCED in foreign key constraints
2 Apr 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetmoderate changesfrom patchset #941 of 8 reviewers saw the final version

Combines the trigger-discovery and foreign-key feature patches from #94, omitting its optional differing-enforceability merge patch. As confirmed in #95, Peter also adds the get_relation_foreign_keys() enforcement filter in src/backend/optimizer/util/plancat.c and corrects expected trigger output.

  • Joel Jacobsonsaw an earlier versiontrailerIn #2, Joel tested the initial series, reviewed documentation, and supported dropping and recreating triggers, before substantial implementation changes.
  • Andrew Dunstansaw an earlier versiontrailerIn #3, Andrew endorsed removing and recreating triggers to avoid enable/disable complications in the initial design.
  • Peter Eisentrautsaw the final versiontrailerPeter reviewed syntax, transitions, recursion, merging and tests throughout the thread, then reviewed and edited the committed version as described in #95.
  • jian hesaw an earlier versiontrailerJian examined the remaining foreign-key routines in #26 and exposed accidental enforcement changes during ALTER DEFERRABLE in #41, before the later restructuring.
  • Alvaro Herrerasaw an earlier versiontrailerAlvaro challenged validity semantics and recursion, accepted the revised layout in #81, and argued against redundant constraints in #91, before the final mismatch and optimizer changes.
  • Ashutosh Bapatsaw an earlier versiontrailerAshutosh debated state transitions and reviewed regression coverage in #87 and #93, but the final implementation also changed mismatch handling and optimizer behavior.
  • Isaac Morlandsaw an earlier versiontrailerIsaac challenged the four-state model in #57 and #59, arguing that unenforced constraints cannot be assumed valid before the three-state rework.
  • Alexandra Wangsaw an earlier versiontrailerAlexandra reviewed every patch and ran make check in #76, before the recursion redesign, validity changes and final attachment rules.
Expand test a bit
27 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 99% surepart of a posted patchsetlight changesfrom patchset #822 of 2 reviewers saw the final version

Extracts only the convalidated projection and corresponding existing-row output from the inherit.sql changes in #82. The additional constraint cases and all feature code remain outside this commit.

  • Alexandra Wangsaw the final versionLLM analysis, 88% sureIn #76, Alexandra reviewed and tested the series and explicitly discussed its added convalidated test output; the committed extraction retains that display change.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
refactor: Pass relation OID instead of Relation to createForeignKeyCheckTriggers()
25 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #822 of 2 reviewers saw the final version

Takes the complete OID-argument prerequisite from #82, leaving the other series components for separate commits. Applying the attachment to the commit parent produces identical tablecmds.c code apart from signature line wrapping; despite the subject, the changed function is createForeignKeyActionTriggers().

  • Alexandra Wangsaw the final versionLLM analysis, 99% sureAlexandra reviewed and ran make check on every component in #76, including this OID-argument patch, which subsequently remained unchanged apart from formatting.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
refactor: Split ATExecAlterConstraintInternal()
25 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetmoderate changesfrom patchset #821 of 3 reviewers saw the final version

Takes the ATExecAlterConstraintInternal() split from #82, with the helper-name adjustment and restoration of the changed guard on deferrability recursion described in #83.

  • Alvaro Herrerasaw an earlier versionLLM analysis, 99% sureAlvaro explicitly accepted the simpler function layout in #81, but Peter subsequently restored the recursion guard when committing.
  • Alexandra Wangsaw an earlier versionLLM analysis, 86% sureAlexandra reviewed and tested the earlier child-recursion refactor in #76, whose role this substantially revised split absorbs.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
refactor: Move some code that updates pg_constraint to a separate function
25 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 99% surepart of a posted patchsetlight changesfrom patchset #822 of 2 reviewers saw the final version

Takes the catalog-update helper extraction from #82, renaming UpdateConstraintEntry() to AlterConstrUpdateConstraintEntry() and polishing comments and tuple access while accommodating the current hook code.

  • Alvaro Herrerasaw the final versionLLM analysis, 98% sureAlvaro approved the revised layout containing the shared catalog-update helper in #81, after which this component received only light integration edits.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch

Mar 2025

3 commits
Move RemoveInheritedConstraint() call slightly earlier
11 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #772 of 2 reviewers saw the final version

Exactly matches the RemoveInheritedConstraint() call-order component of #77, including its stable patch ID; the other series components were committed separately or remained pending.

  • Alexandra Wangsaw the final versiontrailerAlexandra reviewed and tested every component in #76, and this call-order patch did not change afterward.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
refactor: Split tryAttachPartitionForeignKey()
11 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #772 of 2 reviewers saw the final version

Takes the tryAttachPartitionForeignKey() refactoring component from #77. Applying that attachment to the commit parent reproduces the committed src/backend/commands/tablecmds.c exactly.

  • Alexandra Wangsaw the final versiontrailerAlexandra reviewed and ran make check on this refactoring in #76, and its code remained unchanged through commitment.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
refactor: re-add ATExecAlterChildConstr()
11 Mar 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #772 of 2 reviewers saw the final version

Exactly matches the component restoring ATExecAlterChildConstr() in #77, including its stable patch ID; it is one prerequisite from the larger series.

  • Alexandra Wangsaw the final versiontrailerAlexandra reviewed and tested the restored helper in #76, followed only by adaptation to the upstream work-queue parameter before commitment.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch

Feb 2025

1 commit
Add ATAlterConstraint struct for ALTER .. CONSTRAINT
19 Feb 2025Álvaro Herreramaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% suremodified before commitsignificant changesfrom patchset #700 of 2 reviewers saw the final version

Derives from Alvaro's standalone revision in #70, jointly credited to Amul and Alvaro. The committed tablecmds.c further replaces the proposed deferrability-specific recursion routines with ATExecAlterConstraintInternal(), removes a subroutine level, and implements recurse/ONLY handling.

  • Peter Eisentrautsaw an earlier versionLLM analysis, 91% surePeter endorsed the new constraint-alteration representation in #51, before Alvaro substantially restructured its execution routines.
  • jian hesaw an earlier versionLLM analysis, 90% sureJian's reproducer in #41 exposed the need to distinguish explicitly requested attribute changes, prompting the new representation introduced in #50.

Jan 2025

2 commits
refactor: split ATExecAlterConstrRecurse()
16 Jan 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #252 of 2 reviewers saw the final version

Takes the ATExecAlterConstrRecurse() refactoring component from #25, as announced in #31. Applying that attachment to the commit parent reproduces tablecmds.c exactly despite differences in diff hunk alignment.

  • jian hesaw the final versiontrailerJian examined the remaining refactoring routines and requested clearer argument documentation in #26, covering the subsequently committed component.
  • Peter Eisentrautsaw the final versioncommittercommitted the patch
Add support for NOT ENFORCED in CHECK constraints
11 Jan 2025Peter Eisentrautmaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1
LLM analysis, 100% surepart of a posted patchsetlight changesfrom patchset #252 of 2 reviewers saw the final version

Takes the CHECK-support component from #25, leaving foreign-key support and its prerequisites pending. Changes include documentation rewriting, regression-output corrections, domain error positioning, and the SQL feature-status entry, consistent with #29.

  • Peter Eisentrautsaw the final versiontrailerPeter reviewed parser, catalog, validation and inheritance behavior, then edited and committed the CHECK component as reported in #29.
  • jian hesaw the final versiontrailerJian supplied validation and parser-crash reproducers throughout review and explicitly said the final CHECK patch looked good in #26.

Credits across 11 commits

Author
Amul Sul11
Alvaro Herrera1
Reviewer
Peter Eisentrautcommitter10
Alexandra Wang4
jian he3
Alvaro Herrera1
Andrew Dunstan1
Ashutosh Bapat1
Isaac Morland1
Joel Jacobson1
Tested by
Triveni N2
Committer
Peter Eisentraut10
Alvaro Herrera1