public inbox for [email protected]  
help / color / mirror / Atom feed
From: shveta malik <[email protected]>
To: Chao Li <[email protected]>
Cc: 南拓弥 <[email protected]>
Cc: [email protected]
Cc: shveta malik <[email protected]>
Subject: Re: Warn on missing replica identity in CREATE/ALTER PUBLICATION
Date: Thu, 23 Apr 2026 12:37:41 +0530
Message-ID: <CAJpy0uBWUR+nBfqHaDOwPAZvg7xT-9yEiYSwJVtp=vwVGJq_wA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAP6NMUKYgRJ3Z5ThhtXpYYkRBffT=fAStwQ3_1Cab0tREZ=5NQ@mail.gmail.com>
	<CAJpy0uAd2BY_jinMWscfLr11WHra7sxrNc18jKbkhp=4CkAFig@mail.gmail.com>
	<CAP6NMUJEvkD1BKm8YCVch5YhcwqaVeLQXWGQhqF-+gdDufgs3w@mail.gmail.com>
	<[email protected]>

On Thu, Apr 23, 2026 at 12:21 PM Chao Li <[email protected]> wrote:
>
>
>
> > On Apr 23, 2026, at 13:46, 南拓弥 <[email protected]> wrote:
> >
> > # Reply draft v2 to Shveta
> >
> > ---
> >
> > Hi Shveta,
> >
> > Thanks for pointing out that thread. I've read through it carefully.
> >
> > I believe the two proposals address different aspects of the same
> > problem:
> >
> > - The fallback RI approach changes runtime behavior so that tables
> >  without a primary key can still replicate UPDATE/DELETE.
> > - This proposal simply warns at DDL time that a publication contains
> >  tables whose replica identity will cause UPDATE/DELETE to fail at
> >  replication time.
> >
> > A WARNING at publication creation time is useful regardless of whether
> > a fallback mechanism exists, because:
> >
> > - If a table has REPLICA IDENTITY DEFAULT with no primary key, it
> >  silently falls back to NOTHING. Combining that with a publication
> >  that publishes updates/deletes is guaranteed to fail at runtime.
> >  A WARNING at DDL time closes this gap.
> > - Even users who explicitly set REPLICA IDENTITY NOTHING and add the
> >  table to an update/delete publication would benefit from a reminder,
> >  since that combination cannot succeed.
> > - The WARNING does not change any existing behavior — it only makes
> >  the misconfiguration visible earlier.
> >
> > Notably, Euler mentioned in that thread [1] that he would "suggest a
> > way to disallow or add a warning message while creating the
> > publication or adding new tables", which is exactly what this proposal
> > does.
> >
> > That said, I see the two proposals as complementary. Should I continue
> > this as a separate thread, or would it be better to join the existing
> > discussion?
> >
> > I have a working patch covering all publication paths (FOR TABLE,
> > FOR TABLES IN SCHEMA, FOR ALL TABLES, ALTER PUBLICATION). Happy to
> > post it either way.
> >
> > [1] https://www.postgresql.org/message-id/a9da608f-24be-4213-a712-8592852d37f1%40app.fastmail.com
> >
>
> You are very welcome to join the thread, as the initiator of that thread.
>
> I am not personally against your idea of adding such a warning message, but I think it would be better to consider the two features together as a whole solution from a system perspective.
>
> In any case, new features will have to wait for v20 until July, so we still have time for more discussion and deeper consideration.

I agree. But if the RI fallback option gets delayed due to lack of
consensus on the design or other reasons, issuing a WARNING during
publication creation seems like a reasonable approach.

thanks
Shveta





view thread (5+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Warn on missing replica identity in CREATE/ALTER PUBLICATION
  In-Reply-To: <CAJpy0uBWUR+nBfqHaDOwPAZvg7xT-9yEiYSwJVtp=vwVGJq_wA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox