Archiving
archive_mode
Parameter description: Specifies whether to archive WALs.
This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.
NOTICE:
When wal_level is set to minimal, the archive_mode parameter is unavailable.
Value range: Boolean
- on indicates that the archiving is enabled.
- off indicates that the archiving is disabled.
Default value: off
archive_command
Parameter description: Specifies the command set by the administrator to archive WALs. You are advised to set the archive log path to an absolute path.
This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.
NOTICE:
- Any %p in the string is replaced by the absolute path of the file to archive, and any %f is replaced by only the file name. (The relative path is relative to the data directory.) Use %% to embed an actual % character in the command.
- This command returns zero only if it succeeds. The following shows the command:
archive_command = 'cp --remove-destination %p /mnt/server/archivedir/%f'
- --remove-destination indicates that files will be overwritten during the archiving.
Value range: a string
Default value: (disabled)
archive_timeout
Parameter description: Specifies the archiving period.
This parameter is a SIGHUP parameter. Set it based on instructions provided in Table 1.
NOTICE:
- The server is forced to switch to a new WAL segment file when the period specified by this parameter has elapsed since the last file switch.
- Archived files that are closed early due to a forced switch are still of the same length as full files. Therefore, a very short archive_timeout will bloat the archive storage. You are advised to set archive_timeout to 60s.
Value range: an integer ranging from 0 to INT_MAX. The unit is second. 0 indicates that archiving timeout is disabled.
Default value: 0