Consideration for Restoring FSBased Backup Set on PostgreSQL 12

For PostgreSQL version 11 and earlier, on starting the PostgreSQL server, it goes into recovery mode if recovery.conf file is present in the data directory. This file contains all the parameters to perform the log recovery operation.

For PostgreSQL version 12, set the recovery related parameters in the postgresql.conf file. For running a restore operation using PostgreSQL Agent, if the user does not select the Recover Database Server check box while performing the recovery operation, or if the server fails to start, then the restore operation creates the postgresql.conf.with_recovery_command_cv file in the data directory. At the bottom of this file, all the minimum recovery parameters required to start the server are added as shown below:

> restore_command = 'cp /srv/pgsql/wal/%f %p'

> recovery_end_command = 'touch /srv/pgsql/data/recovery.done.cv'

> recovery_target_time = '2020-03-17 08:11:26GMT'

> recovery_target_action = promote

Copy these parameters from the postgresql.conf.with_recovery_command_cv file to the postgresql.conf file. Substitute the values of these parameters based on your environment, and then start the PostgreSQL server.

After the PostgreSQL is online, remove the parameters from the postgresql.conf file.

Note: The recovery_target_time parameter is needed only for running a point-in-time restore operation.

Last modified: 2/19/2021 3:55:36 PM