recovery.conf
recovery.conf
is a simple configuration file placed in the top level of the data directory which is used with standby servers to specify the location of the primary server for streaming replication, or when starting up a server using archived WAL files, or performing PITR.
recovery.conf
was added in PostgreSQL 8.0 and removed in PostgreSQL 12.
As a file for configuring streaming replication, its name is somewhat counterintuitive, but makes sense from the historical development of PostgreSQL's replication methods. It might be an idea to think of streaming replication standbys as "permanently in recovery".
Usage
Note that in contrast to other directly editable configuration files, recovery.conf
cannot be relocated outside of the data directory.
If a standby is promoted, recovery.conf
is renamed to recovery.done
.
Internals
recovery.conf
is processed by src/backend/access/transam/xlog.c (PostgreSQL 11 and earlier).
Replacement
From PostgreSQL 12, recovery.conf
is replaced by a simple file (standby.signal
) which initiates recovery, while the settings it contained have become normal configuration parameters.
Change history
- PostgreSQL 12
- removed (commit 2dedf4d9)
- PostgreSQL 8.0
- added (initial commit 66ec2db7)
Examples
A sample recovery.conf
file is included in the source code at src/backend/access/transam/recovery.conf.sample, though it does not contain all possible parameters.
References
- PostgreSQL 11 documentation: Recovery Configuration