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

From: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Date: 2025-03-19 09:01:41
Message-ID: CAHv8RjKbYaCRrzJzmU6gU0jt85xJftzVV-Hu9rXrkb1yFzYTtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 19, 2025 at 12:29 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
>
> Dear Shubham,
>
> One comment for the API. Currently the patch introduces new option '--remove',
> and the short term is '-r'. My suggestion is to use '-R' instead.
>
> Background
> ==========
> IIUC, we've planned to put outut-logs in some files on the directory [1].
> This follows what pg_ugprade does.
>
> In pg_uprade, -r means "retain SQL and log files even after successful completion" [2].
> Normally logs would be removed after the sucessful upgrade, but they would not with
> the option.
>
> If we use -r for removing objects in pg_createsubscriber, it would be conflicted
> with the short term of --retain. This is confusing for users.
>
> [1]: https://www.postgresql.org/message-id/60b45b8a-3047-4a21-ba2a-ddb15daa638f%40eisentraut.org
> [2]: https://www.postgresql.org/docs/devel/pgupgrade.html
>

Changed -r to -R based on the shared analysis to avoid conflict with
the --retain option used in pg_upgrade and to maintain consistency
across tools.

The attached patch contains the suggested change.

Thanks and regards,
Shubham Khanna.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shubham Khanna 2025-03-19 09:04:10 Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.
Previous Message vignesh C 2025-03-19 08:58:58 Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.