Oct 2024

2 commits
Fix some more bugs in foreign keys connecting partitioned tables
30 Oct 2024Álvaro Herreramaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1REL_17_STABLE17.1REL_16_STABLE16.5REL_15_STABLE15.9
LLM analysis, 99% suremodified before commitmoderate changesfrom patchset #630 of 2 reviewers saw the final version

Retains the attribute-map removal, parent-tuple cleanup, DETACH locking change and regression tests from #63. The committed src/backend/commands/tablecmds.c additionally strengthens CloneFkReferenced() locking and adds lock assertions in both recursive helpers, constituting moderate local changes.

  • Alexander Lakhinsaw an earlier versionLLM analysis, 88% sureIn #52, he supplied a Valgrind reproducer for the memory-access regression introduced by #46, prompting this follow-up, but did not review the later corrective patches.
  • Tender Wangsaw an earlier versionLLM analysis, 93% sureHe approved #60 and proposed removing parentConTup in #61, then reviewed #63 in #64, before the commit added further CloneFkReferenced() locking changes.
Restructure foreign key handling code for ATTACH/DETACH
22 Oct 2024Álvaro Herreramaster18beta1REL_19_STABLE18beta1REL_18_STABLE18beta1REL_17_STABLE17.1REL_16_STABLE16.5REL_15_STABLE15.9REL_14_STABLE14.14REL_13_STABLE13.17Also in: BUG #18541: Reattaching a partition referenced by a foreign key fails with an error (not this thread)Also in: [BUG] FK broken after DETACHing referencing partAlso in: Detach Partition produces a --> SQL-Fehler [XX000]: ERROR: could not find ON INSERT check triggers of foreign key constraint 76908
LLM analysis, 85% suremodified before commitlight changesfrom patchset #440 of 1 reviewer saw the final version

The actual diff implements ATTACH cleanup and older-branch drop-on-DETACH behavior in src/backend/commands/tablecmds.c from #44, with the trivial PostgreSQL 13 adaptation described in #46 and rewritten commit text; unavailable extracted attachments prevent exact comparison. This October submission postdates the nonmatching August patch in thread #72625, so its from_discussion verdict does not establish ownership over this matching patchset; thread #47776 and thread #72476 contain no competing patchsets.

  • Junwang Zhaosaw an earlier versionLLM analysis, 90% sureHe examined #15 and supplied additional action-trigger handling in #18, before the implementation was substantially reworked and split into branch-specific strategies.

Credits across 2 commits

Author
Alvaro HerreraLLM1
Reported by
Baehler Thomas SBB CFF FFS1
Guillaume Lelarge1
Jehan-Guillaume de Rorthais1
Co author
Alvaro Herrera1
Jehan-Guillaume de Rorthais1
Tender Wang1
Committer
Alvaro Herrera2

N LLM means N of the credits come from LLM analysis, not from commit trailers.