0

Context

I have a pretty standard postgresql setup, with one main server and one hot standby.

I am testing a procedure to promote the standby server when the main server stops, and then turn the previous main server into a new standby.

When I call pg_rewind, I add the -c option, to instruct pg_rewind to look for possibly archived wal files.

My issue

The archive_command/restore_command of my postgres configuration call scripts relative to the data directory :

achive_command='./archive_wal.sh "%p"'
restore_command='./restore_wal.sh "%f" "%p"'

Unfortunately, when running pg_rewind -c, it tries to find these commands relative to my cwd, and not relative to the --target-pgdata=data directory.

Question

Is there a way to have pg_rewind -c use the data directory as the base directory for the restore command ?

LeGEC
  • 46,477
  • 5
  • 57
  • 104

0 Answers0