... | ... | @@ -1031,11 +1031,26 @@ information on how to pick a restore procedure. |
|
|
(e.g. `main`, generally)
|
|
|
|
|
|
You can specify a specific recovery point in the `recovery.conf`,
|
|
|
see the [upstream documentation](https://www.postgresql.org/docs/11/recovery-target-settings.html) for more information. Also
|
|
|
make sure the file is owned by postgres:
|
|
|
|
|
|
$EDITOR /var/lib/postgresql/9.6/main/recovery.conf
|
|
|
chown postgres /var/lib/postgresql/9.6/main/recovery.conf
|
|
|
see the [upstream documentation](https://www.postgresql.org/docs/13/runtime-config-wal.html#RUNTIME-CONFIG-WAL-RECOVERY-TARGET) for more information. This,
|
|
|
for example, will recover `meronense` from backups of the `main`
|
|
|
cluster up to October 1st, and then start accepting connections
|
|
|
(`promote`, other options are `pause` to stay in standby to accept
|
|
|
more logs or `shutdown` to stop the server):
|
|
|
|
|
|
restore_command = '/usr/local/bin/pg-receive-file-from-backup meronense main.WAL.%f %p'
|
|
|
recovery_target_time = '2022-10-01T00:00:00+0000'
|
|
|
recovery_target_action = 'promote'
|
|
|
|
|
|
Also make sure the file is owned by postgres:
|
|
|
|
|
|
$EDITOR /etc/postgresql/13/main/conf.d/recovery.conf
|
|
|
chown postgres /etc/postgresql/13/main/conf.d/recovery.conf
|
|
|
|
|
|
NOTE: a previous version of this guide was suggesting using
|
|
|
`/var/lib/postgresql/9.6/main/recovery.conf` instead, but newer
|
|
|
upstream documentation suggest editing the `postgresql.conf` file
|
|
|
directly. The [upstream guide](https://www.postgresql.org/docs/11/recovery-config.html) wasn't quite clear on where the
|
|
|
`recovery.conf` file went in the first place...
|
|
|
|
|
|
8. Then start the server and look at the logs to follow the recovery
|
|
|
process:
|
... | ... | |