Re: Initial table sync copies the whole table when it is no longer published

From: vignesh C <vignesh21(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Initial table sync copies the whole table when it is no longer published
Date: 2026-11-19 10:33:06
Message-ID: CALDaNm19EHDGrYxrLsV-ABjiM0MKSWN9Bt1e62oCxw-gQJOzxQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 19 Nov 2026 at 14:52, shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> > 2. The REFRESH PUBLICATION block can be removed:
> > +# REFRESH PUBLICATION removes the tables from the subscription.
> > +$node_subscriber->safe_psql('postgres',
> > + "ALTER SUBSCRIPTION tap_sub_2 REFRESH PUBLICATION");
> > +
> > +$result = $node_subscriber->safe_psql('postgres',
> > + "SELECT count(*) FROM pg_subscription_rel WHERE srrelid IN
> > ('tab_4'::regclass, 'tab_5'::regclass)"
> > +);
> > +is($result, qq(0),
> > + 'check that REFRESH PUBLICATION removes the tables from the
> > subscription');
> >
> > 025_rep_changes_for_schema.pl already checks that tables are removed
> > from pg_subscription_rel after REFRESH
> > PUBLICATION.
>
> I gave it some thought; I think we should keep it. Both the errhint
> and the doc patch suggest REFRESH PUBLICATION as the way to recover,
> so it seems good to test that it works in exactly the state this fix
> leaves behind, i.e. tables whose initial sync failed and are still in
> DATASYNC. 025 only removes tables that are already READY. What do you
> say?

I'm fine with it.

This issue is applicable to back branches also, can you share back
branch patches too.

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-11-19 10:38:00 Re: A latent pointer increment bug in pgtypes_defmt_scan()
Previous Message Amit Kapila 2026-11-19 10:31:25 Re: Add a hook for handling logical decoding messages on subscribers.