
When used as a standalone program all WAL files logically preceding the oldestkeptwalfile will be removed from archivelocation. Use of this parameter is appropriate if the archivelocation is a transient staging area for this particular standby server, but not when the archivelocation is intended as a long-term WAL archive area, or when multiple standby servers are recovering from the same archive location.

This minimizes the number of files that need to be retained, while preserving crash-restart capability. When used within archive_cleanup_command, all WAL files logically preceding the value of the %r argument will be removed from archivelocation. Where archivelocation is the directory from which WAL segment files should be removed.

To configure a standby server to use pg_archivecleanup, put this into its nf configuration file:Īrchive_cleanup_command = 'pg_archivecleanup archivelocation %r' pg_archivecleanup can also be used as a standalone program to clean WAL file archives.

Pg_archivecleanup is designed to be used as an archive_cleanup_command to clean up WAL file archives when running as a standby server (see Section 27.2).
