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-14 06:39:22
Message-ID: CAKFQuwZtG68kb5WZc3mWkovLSTOO+GC6MkvqzRQQ5W9R=i3RdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, March 11, 2025, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:

>
> Choice 3. Implement some option that has an argument saying what to delete
>
> Implement an option that takes some argument saying what objects to remove.
>
> Here, the current patch would be something like:
> "--remove-target-objects=publications". In future, this option could
> be enhanced to accept other values like
> "--remove-target-objects=publications,subscriptions" etc.
>

I’m changing my vote to option 3. With a requirement that dropping is done
post-recovery by the user via psql - we just provide the commands we would
have executed in a script.

—prune-file=‘drop-commands.psql’
—prune=publications
—prune=subscriptions
Etc…

I’d rather do multiple specifications than commas separated. It matches
what we already do with databases, which was done this way I suspect for
the same reasons - length of the parameters value when we have:
Publications
Slots
Subscriptions
Databases
Roles
Tablespaces

Redefining All over the course of years as we decide to add object types is
unappealing. Even if we expect the DBA to check the drop-commands.sql file
before executing it. Which I’d still require them to do instead of
providing CLI options to specify, e.g., slot names or database names to not
drop if they want some subset of All.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2025-03-14 07:25:22 Re: SQL/JSON json_table plan clause
Previous Message Alexander Pyhalov 2025-03-14 06:33:48 Re: SQLFunctionCache and generic plans