Bug in statement trigger for MERGE operations that move rows between partitions

Started by Michael Ries16 days ago2 messagesbugs
Jump to latest
#1Michael Ries
mries@salesforce.com

Attachments:

pg_bug_report_merge_statement_trigger.mdtext/markdown; charset=UTF-8; name=pg_bug_report_merge_statement_trigger.mdDownload+45-31
#2Michael Ries
mries@salesforce.com
In reply to: Michael Ries (#1)
Re: Bug in statement trigger for MERGE operations that move rows between partitions

Following up on my bug report on October 8th, I think putting it in a
markdown file was not the convention for this mailing list.
The bug occurs after PG 15.6+ or PG 16.2+. When a MERGE UPDATE action
moves a row to another partition, the row is missing from the
statement-level AFTER UPDATE transition tables (OLD TABLE/ NEW TABLE).
A plain UPDATE that moves the row is correct on every version I
tested. The row movement can be seen on a local build before commit
c0bfdaf2b (REL_15) / 06a546382 (REL_16) / a4f7d33a9 (master)

A brief psql repro is in the markdown file along with a minimal patch
to fix the issue on REL_15. I'm happy to help open a PR or otherwise
suggest fixes, but I first wanted to open the bug and see if anyone
has guidance on how to handle it from here.

Show quoted text

On Thu, Oct 8, 2026 at 3:44 PM Michael Ries <mries@salesforce.com> wrote: