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

From: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Peter Smith <smithpb2250(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-17 12:34:23
Message-ID: CAHv8RjJ_ZRbv+FyZPJFby7Xm0K4e_J1PAAzENFeQiGKB9rFhLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 17, 2025 at 8:44 AM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Sat, Mar 15, 2025 at 8:03 PM David G. Johnston
> <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> >
> > On Friday, March 14, 2025, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >>
> >>
> >> Style-1 sounds reasonable to me, but how exactly we want to do. One
> >> idea is to have short and long switches like -r and
> >> --remove_exiting_object=publication. The user would be allowed to give
> >> multiple options like -r publications -r slots, etc.
> >
> >
> > Either “existing” nor “object” are needed, a one-word long form suffices. Drop, remove, or prune. If we want a short form option we should choose Remove and use -r; both D and P are already taken.
> >
> > So, I marginally prefer —prune with no short-form option; followed by —remove/-r
> >
>
> I am inclined towards "--remove/-r" as that will be relatively more
> straightforward to follow for users.
>
> > Communicating the semantic meaning of “prune” in the option name, we aren’t removing all objects of the given type, tips the balance for me. But that can just be communicated in the description so it isn’t a strong desire.
> >
>
> BTW, with this option, we will be removing all the publications
> present on the subscriber because on standby there shouldn't be any
> more. But that may not be true for other objects, so we must
> communicate it via the description.
>
> --

I have incorporated the "--remove/-r" parameter in the attached patch,
as it seems more intuitive and straightforward for users.
The attached patch contains the latest changes.

Thanks and regards,
Shubham Khanna,

Attachment Content-Type Size
v17-0001-Support-for-dropping-all-publications-in-pg_crea.patch application/octet-stream 16.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2025-03-17 12:37:27 Re: Allow default \watch interval in psql to be configured
Previous Message Thomas Munro 2025-03-17 12:18:37 Re: Snapshot related assert failure on skink