Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility. - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Date
Msg-id CAKFQuwaed2fr2k81kWw-UB6wp2SsitXj=9FFvvzcOT_qQtg43Q@mail.gmail.com
Whole thread Raw
In response to Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
List pgsql-hackers
On Mon, Mar 10, 2025 at 5:00 PM Peter Smith <smithpb2250@gmail.com> wrote:
Hi Shubham.

Some review comments for patch v16-0001.

======
doc/src/sgml/ref/pg_createsubscriber.sgml

1.
+     <term><option>-c</option></term>
+     <term><option>--drop-all-publications</option></term>

Is 'c' the best switch choice letter for this option? It doesn't seem
intuitive, but unfortunately, I don't have any better ideas since d/D
and p/P are already being used.

Agreed.  Better to just not assign a short name to this.

The description for the sgml docs needs to frame up this option's purpose.

How exactly does one go about backing up a publication?  You discuss the topic in the commit message but that definitely seems user-facing.

If we aren't expecting lots of publications maybe name them individually instead of logging "all publications"?  Possibly one info line each but even just comma separated would work.

The name of this is shock-inducing.  Admittedly, after pondering things, it is fairly obvious that only the target is going to be affected, but there is a source database involved here as well.  It is also unclear on whether it would happen before or after, which is less problematic since it would only impact failure modes anyway - when all is said and done with this specified upon restart following the pg_resetwal the server will have no publications, right?

Maybe: --drop-target-publications-first ?

If we do want a letter either "X" or "Z" probably works for an English-speaking audience probably.  X is how one denotes removing something; and Z is a mnemonic for "Zap" which is a synonym for "Drop". "R" for "Remove".

Can you briefly recap how this is different than the automatic behavior described in the existing Step 6?
"Drop publications on the target server that were replicated because they were created before the replication start location. It has no use on the subscriber."

-R --remove-target-publications; I fine with answering the timing question to the description.

David J.







pgsql-hackers by date:

Previous
From: Maciek Sakrejda
Date:
Subject: Question about duplicate JSONTYPE_JSON check
Next
From: Tom Lane
Date:
Subject: Re: Memory context can be its own parent and child in replication command