| The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide
by The PostgreSQL Global Development Group Paperback (6"x9"), 274 pages ISBN 9781906966072 RRP £9.95 ($14.95) Sales of this book support the PostgreSQL project! Get a printed copy>>> |
12.1 Archive recovery settings
restore_command(string)-
The shell command to execute to retrieve an archived segment of
the WAL file series. This parameter is required for archive recovery,
but optional for streaming replication.
Any
%fin the string is replaced by the name of the file to retrieve from the archive, and any%pis replaced by the copy destination path name on the server. (The path name is relative to the current working directory, i.e., the cluster's data directory.) Any%ris replaced by the name of the file containing the last valid restart point. That is the earliest file that must be kept to allow a restore to be restartable, so this information can be used to truncate the archive to just the minimum required to support restarting from the current restore.%ris typically only used by warm-standby configurations (see section 11.2 Log-Shipping Standby Servers). Write%%to embed an actual%character. It is important for the command to return a zero exit status only if it succeeds. The command will be asked for file names that are not present in the archive; it must return nonzero when so asked. Examples:restore_command = 'cp /mnt/server/archivedir/%f "%p"' restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
archive_cleanup_command(string)-
This parameter specifies a shell command that will be executed at
every restartpoint. This parameter is optional. The purpose of the
archive_cleanup_commandis to provide a mechanism for cleaning up old archived WAL files that are no longer needed by the standby server. Any%ris replaced by the name of the file containing the last valid restart point. That is the earliest file that must be kept to allow a restore to be restartable, so this information can be used to truncate the archive to just the minimum required to support restart from the current restore.%rwould typically be used in a warm-standby configuration (see section 11.2 Log-Shipping Standby Servers). Write%%to embed an actual%character in the command. If the command returns a non-zero exit status then a WARNING log message will be written. recovery_end_command(string)-
This parameter specifies a shell command that will be executed once only
at the end of recovery. This parameter is optional. The purpose of the
recovery_end_commandis to provide a mechanism for cleanup following replication or recovery. Any%ris replaced by the name of the file containing the last valid restart point, like inarchive_cleanup_command. If the command returns a non-zero exit status then a WARNING log message will be written and the database will proceed to start up anyway. An exception is that if the command was terminated by a signal, the database will not proceed with startup.
| ISBN 9781906966072 | The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide | See the print edition |