Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: Shubham Khanna <khannashubham1197(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Date: 2025-03-11 00:31:41
Message-ID: CAKFQuwaed2fr2k81kWw-UB6wp2SsitXj=9FFvvzcOT_qQtg43Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 10, 2025 at 5:00 PM Peter Smith <smithpb2250(at)gmail(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-03-11 01:13:17 Re: Memory context can be its own parent and child in replication command
Previous Message Maciek Sakrejda 2025-03-11 00:11:48 Question about duplicate JSONTYPE_JSON check