Re: PATCH: add "--config-file=" option to pg_rewind - Mailing list pgsql-hackers

From Alexander Kukushkin
Subject Re: PATCH: add "--config-file=" option to pg_rewind
Date
Msg-id CAFh8B=mR--gD0hMgn3a2ygLoen-ZkY2k=pJoLcvDToiUUQJ-ug@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: add "--config-file=" option to pg_rewind  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: PATCH: add "--config-file=" option to pg_rewind  (Aleksander Alekseev <aleksander@timescale.com>)
Re: PATCH: add "--config-file=" option to pg_rewind  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
Hello Gunnar,

On Thu, 24 Feb 2022 at 10:03, Aleksander Alekseev <aleksander@timescale.com> wrote:
 
> wants to use the "-c" option on a typical Debian/Ubuntu installation
> (where the config resides below /etc/postgresql/), pg_rewind needs a way
> to be told where the postgresql.conf actually is.
>
> The attached patch implements this as an option.
>
> [...]

Good catch!

Yeah, it is a known problem, and there was already another patch trying to address it [1].
Honestly, I like your approach much better, because, the previous make was assuming that the data_directory GUC is specified in the postgresql.conf, which is not very flexible.
 

Could you also implement a TAP test for the new code?

+1 


+       <para>
+        In case the <filename>postgresql.conf</filename> of your target cluster is not in the
+        target pgdata and you want to use the <option>-c</option> option,
+        provide a (relative or absolute) path to the <filename>postgresql.conf</filename> using this option.
+       </para>

It took me a while to understand the meaning of <option>-c</option>. Maybe changing it to <option>--restore-target-wal</option> will make it easier to understand.

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Design of pg_stat_subscription_workers vs pgstats
Next
From: Tatsuo Ishii
Date:
Subject: Re: Typo in pgbench messages.