Re: BUG #19380: Transition table in AFTER INSERT trigger misses rows from MERGE when used with INSERT in a CTE
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: dwwoelfel@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2026-01-20T18:00:56Z
Lists: pgsql-bugs
Attachments
- fix-transition-table-capture-2.patch (text/x-diff) patch
I wrote: > Dean Rasheed <dean.a.rasheed@gmail.com> writes: >> Attached is a rough patch doing that. > I haven't read this in detail, Okay, I've now been through it more carefully, and it looks good except for these nitpicks (addressed in v2 patch attached): * I think GetAfterTriggersTableData() ought to have an Assert that the cmdType used as lookup key is INSERT/UPDATE/DELETE and nothing else. * Corrected grammar in comment in MakeTransitionCaptureState. * Added comment in new switch in AfterTriggerSaveEvent. One could argue that that new switch should have an explicit case for TRIGGER_EVENT_TRUNCATE and then the default: should be elog(ERROR). That seems excessive to me, given that the switch earlier in the same function vetted the event value. But others might see it differently. regards, tom lane
Commits
-
Update .abi-compliance-history for change to TransitionCaptureState.
- 7023650429e9 15.16 landed
- b06e7c10d172 16.12 landed
- 661d55e25737 17.8 landed
- fff87cb50dbd 18.2 landed
-
Fix trigger transition table capture for MERGE in CTE queries.
- c5824536e7ca 15.16 landed
- e7391bbf14db 16.12 landed
- c5fc17ddaccf 17.8 landed
- c6ce4dcf9d3b 18.2 landed
- b4307ae2e540 19 (unreleased) landed