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 14:50:57 |
Message-ID: | CAKFQuwb-4C3L37JbnN7R-AtVE71c+Xy1tTbA=QaTrDzEJzTEEg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Mar 11, 2025 at 12:20 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Unfortunately, we are spinning in circles a bit trying to come up with
> a good way to represent the option needed for this, while at the same
> time trying to be future-proof. I see 3 choices...
>
> ======
>
> Choice 1. Generic option
>
> Implement a single boolean option to remove everything.
>
>
> Do you have any thoughts on what kind of option is best here?
>
>
Option 1 by far. Though personally I'd rather do something like what
pg_upgrade does and output a script with drop commands that can be executed
via psql instead of having pg_createsubscriber execute said commands. I'd
call it "pruning the target".
Any automated bash script I'd write would just do:
pg_createsubscriber ... --prune-target-script=prune.sql
psql --file prune.sql
And if I'm working interactively I'd want to spend the extra minute or so
reviewing the commands in prune.sql to make sure I know what is going
away. I can also edit said file, or use something like grep, if I want to
limit what is dropped.
In particular any database that isn't turned into a logical replica would
be added to this list; in addition to all the publication/subscription
stuff that is likely broken at this point.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2025-03-11 15:16:34 | Re: Optimizing FastPathTransferRelationLocks() |
Previous Message | Jeremy Schneider | 2025-03-11 14:49:05 | Re: protocol support for labels |