restore_command was added in PostgreSQL 8.0.
The default value for
'' (empty string).
Using the following
restore_command as an example:
scp backupuser@backup:/var/lib/backup/wal-archive/%f "%p"
In normal operation, the PostgreSQL log file will contain entries like the following when retrieving archived WAL:
[2021-06-20 10:14:16 UTC] LOG: 00000: restored log file "000000010000000000000004" from archive [2021-06-20 10:14:17 UTC] LOG: 00000: restored log file "000000010000000000000005" from archive [2021-06-20 10:14:17 UTC] LOG: 00000: restored log file "000000010000000000000006" from archive
The log file will also contain entries like the following:
scp: /var/lib/backup/wal-archive/000000010000000000000007: No such file or directory scp: /var/lib/backup/wal-archive/00000002.history: No such file or directory
These are not errors. PostgreSQL will continuously attempt to retrieve the next expected WAL file, and the next history file in case the upstream has been promoted to a new timeline. If the files are not (yet) present, the configured command (here
scp) will report a file-not-found error, which is expected and normal.