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

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Ajin Cherian <itsajin(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, 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-23 04:44:43
Message-ID: CAJpy0uB7UmosVANUi9_xi4soV8tA0urOKti6v54U73mxQBk54w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 23, 2026 at 8:18 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Some review comments for v4
>
> PATCH v4-0002 (docs)
>
> ======
> doc/src/sgml/ref/alter_subscription.sgml
>
> 1.
> + <note>
> + <para>
> + This command cannot be run while the subscription is disabled. If the
> + subscription was disabled by
> + <link linkend="sql-createsubscription-params-with-disable-on-error"><literal>disable_on_error</literal></link>
> + because initial table synchronization keeps failing, for example
> + because the table or the publication was dropped on the publisher, or
> + the table was removed from the publication, this command is needed to
> + remove the table from the subscription. To resolve this, either fix
> + the cause on the publisher before re-enabling the subscription, or
> + temporarily set
> + <literal>disable_on_error</literal> to <literal>false</literal>,
> + re-enable the subscription using
> + <link linkend="sql-altersubscription-params-enable"><command>ALTER
> SUBSCRIPTION ... ENABLE</command></link>,
> + run <command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command>, and
> + then set <literal>disable_on_error</literal> back to
> + <literal>true</literal>.
> + </para>
> + </note>
>
> It's OK, but IMO it wasn't necessary to give so many details about the
> kind of error that might have led to this. IIUC, the main point is
> that you may need to turn off `disable_on_error temporarily.
>
> Also, it seemed a bit wordy to spell out the full commands for "ALTER
> SUBSCRIPTION ... ENABLE" (which is elsewhere on the same page) and for
> "ALTER SUBSCRIPTION ... REFRESH PUBLICATION" (since this note is
> already within the context of that command).
>
> Here is some shorter text for consideration. It keeps the essential
> steps but avoids enumerating failure causes, which may not be
> exhaustive anyway.
>
> <para>
> This command cannot be run while the subscription is disabled. If the
> subscription was disabled by
> <link linkend="sql-createsubscription-params-with-disable-on-error"><literal>disable_on_error</literal></link>,
> temporarily set it to <literal>false</literal>,
> <link linkend="sql-altersubscription-params-enable">re-enable</link>
> the subscription, perform the refresh, and then set it back to
> <literal>true</literal>.
> </para>
>
> YMMV.

I agree with the suggestion. I have incorporated the suggested shorter
text with a few tweaks. Please have a look.

thanks
Shveta

Attachment Content-Type Size
v5-0001-Do-not-copy-the-whole-table-in-tablesync-when-no-.patch application/octet-stream 7.5 KB
v5-0002-Doc-Explain-how-to-recover-a-subscription-disable.patch application/octet-stream 3.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-11-23 05:18:49 Re: Initial table sync copies the whole table when it is no longer published
Previous Message shveta malik 2026-11-23 04:42:41 Re: Initial table sync copies the whole table when it is no longer published