Re: pg_rewind: Skip log directory for file type check like pg_wal

Alexander Kukushkin <cyberdemn@gmail.com>

From: Alexander Kukushkin <cyberdemn@gmail.com>
To: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-03-07T08:03:21Z
Lists: pgsql-hackers
On Tue, 7 Mar 2023 at 08:52, Soumyadeep Chakraborty <
soumyadeep2007@gmail.com> wrote:

>
> > It couldn't be achieved just by introducing a static string "log". The
> "log_directory" GUC must be examined on both, source and target.
>
> Trouble with doing that is if pg_rewind is run in non-libpq (offline)
> mode. Then we would have to parse it out of the conf file(s)?
> Is there a standard way of doing that?
>

pg_rewind is already doing something similar for "restore_command":
/*
 * Get value of GUC parameter restore_command from the target cluster.
 *
 * This uses a logic based on "postgres -C" to get the value from the
 * cluster.
 */
static void
getRestoreCommand(const char *argv0)

For the running source cluster one could just use "SHOW log_directory"

Regards,
--
Alexander Kukushkin