Re: Fix replica identity checks for MERGE command on published table.

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix replica identity checks for MERGE command on published table.
Date: 2025-07-11 07:09:19
Message-ID: CAEZATCVeLCyEBE44JetuiTadDnovTsy7+JrvxFO6LitABtvU4A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 8 Jul 2025 at 09:51, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:
>
> Answering my own question, INSERT ... ON CONFLICT DO UPDATE does have
> the same problem as MERGE. To reproduce the error, all you need to do
> is create the unique index it needs *after* creating the publication

The other question is whether we want to back-patch these fixes.

In HEAD, it would be OK to change the signature of
CheckValidResultRel() and pass it an onConflictAction argument to fix
the ON CONFLICT DO UPDATE issue. However, I don't think that such a
change would be back-patchable.

Arguably though, the ON CONFLICT DO UPDATE issue is much less likely
to be a problem in practice, since it looks like it only happens if
the table definition is changed after creating the publication. So
perhaps it would be acceptable to apply and back-patch the original
patch for MERGE to v15, and fix the ON CONFLICT DO UPDATE issue in
HEAD only.

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2025-07-11 07:49:09 Re: array_random
Previous Message Amit Langote 2025-07-11 06:51:57 Re: Proposal: Global Index for PostgreSQL