Re: Fix replica identity checks for MERGE command on published table. - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Fix replica identity checks for MERGE command on published table.
Date
Msg-id CAEZATCVeLCyEBE44JetuiTadDnovTsy7+JrvxFO6LitABtvU4A@mail.gmail.com
Whole thread Raw
In response to Re: Fix replica identity checks for MERGE command on published table.  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-hackers
On Tue, 8 Jul 2025 at 09:51, Dean Rasheed <dean.a.rasheed@gmail.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



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Proposal: Global Index for PostgreSQL
Next
From: Dean Rasheed
Date:
Subject: Re: array_random