1# ------------------------------- 2# PostgreSQL recovery config file 3# ------------------------------- 4# 5# Edit this file to provide the parameters that PostgreSQL needs to 6# perform an archive recovery of a database, or to act as a replication 7# standby. 8# 9# If "recovery.conf" is present in the PostgreSQL data directory, it is 10# read on postmaster startup. After successful recovery, it is renamed 11# to "recovery.done" to ensure that we do not accidentally re-enter 12# archive recovery or standby mode. 13# 14# This file consists of lines of the form: 15# 16# name = value 17# 18# Comments are introduced with '#'. 19# 20# The complete list of option names and allowed values can be found 21# in the PostgreSQL documentation. 22# 23#--------------------------------------------------------------------------- 24# ARCHIVE RECOVERY PARAMETERS 25#--------------------------------------------------------------------------- 26# 27# restore_command 28# 29# specifies the shell command that is executed to copy log files 30# back from archival storage. The command string may contain %f, 31# which is replaced by the name of the desired log file, and %p, 32# which is replaced by the absolute path to copy the log file to. 33# 34# This parameter is *required* for an archive recovery, but optional 35# for streaming replication. 36# 37# It is important that the command return nonzero exit status on failure. 38# The command *will* be asked for log files that are not present in the 39# archive; it must return nonzero when so asked. 40# 41# NOTE that the basename of %p will be different from %f; do not 42# expect them to be interchangeable. 43# 44#restore_command = '' # e.g. 'cp /mnt/server/archivedir/%f %p' 45# 46# 47# archive_cleanup_command 48# 49# specifies an optional shell command to execute at every restartpoint. 50# This can be useful for cleaning up the archive of a standby server. 51# 52#archive_cleanup_command = '' 53# 54# recovery_end_command 55# 56# specifies an optional shell command to execute at completion of recovery. 57# This can be useful for cleaning up after the restore_command. 58# 59#recovery_end_command = '' 60# 61#--------------------------------------------------------------------------- 62# RECOVERY TARGET PARAMETERS 63#--------------------------------------------------------------------------- 64# 65# By default, recovery will rollforward to the end of the WAL log. 66# If you want to stop rollforward at a specific point, you 67# must set a recovery target. 68# 69# You may set a recovery target either by transactionId, by name, by 70# timestamp or by WAL location (LSN). Recovery may either include or 71# exclude the transaction(s) with the recovery target value (i.e., 72# stop either just after or just before the given target, 73# respectively). 74# 75# 76#recovery_target_name = '' # e.g. 'daily backup 2011-01-26' 77# 78#recovery_target_time = '' # e.g. '2004-07-14 22:39:00 EST' 79# 80#recovery_target_xid = '' 81# 82#recovery_target_lsn = '' # e.g. '0/70006B8' 83# 84#recovery_target_inclusive = true 85# 86# 87# Alternatively, you can request stopping as soon as a consistent state 88# is reached, by uncommenting this option. 89# 90#recovery_target = 'immediate' 91# 92# 93# If you want to recover into a timeline other than the "main line" shown in 94# pg_control, specify the timeline number here, or write 'latest' to get 95# the latest branch for which there's a history file. 96# 97#recovery_target_timeline = 'latest' 98# 99# 100# If recovery_target_action = 'pause', recovery will pause when the 101# recovery target is reached. The pause state will continue until 102# pg_wal_replay_resume() is called. This setting has no effect if 103# no recovery target is set. If hot_standby is not enabled then the 104# server will shutdown instead, though you may request this in 105# any case by specifying 'shutdown'. 106# 107#recovery_target_action = 'pause' 108# 109#--------------------------------------------------------------------------- 110# STANDBY SERVER PARAMETERS 111#--------------------------------------------------------------------------- 112# 113# standby_mode 114# 115# When standby_mode is enabled, the PostgreSQL server will work as a 116# standby. It will continuously wait for the additional XLOG records, using 117# restore_command and/or primary_conninfo. 118# 119#standby_mode = off 120# 121# primary_conninfo 122# 123# If set, the PostgreSQL server will try to connect to the primary using this 124# connection string and receive XLOG records continuously. 125# 126#primary_conninfo = '' # e.g. 'host=localhost port=5432' 127# 128# If set, the PostgreSQL server will use the specified replication slot when 129# connecting to the primary via streaming replication to control resource 130# removal on the upstream node. This setting has no effect if primary_conninfo 131# is not set. 132# 133#primary_slot_name = '' 134# 135# By default, a standby server keeps restoring XLOG records from the 136# primary indefinitely. If you want to stop the standby mode, finish recovery 137# and open the system in read/write mode, specify a path to a trigger file. 138# The server will poll the trigger file path periodically and start as a 139# primary server when it's found. 140# 141#trigger_file = '' 142# 143# By default, a standby server restores XLOG records from the primary as 144# soon as possible. If you want to explicitly delay the replay of committed 145# transactions from the master, specify a minimum apply delay. For example, 146# if you set this parameter to 5min, the standby will replay each transaction 147# commit only when the system time on the standby is at least five minutes 148# past the commit time reported by the master. 149# 150#recovery_min_apply_delay = 0 151# 152#--------------------------------------------------------------------------- 153# HOT STANDBY PARAMETERS 154#--------------------------------------------------------------------------- 155# 156# Hot Standby related parameters are listed in postgresql.conf 157# 158#--------------------------------------------------------------------------- 159