Type: enum
Default: off
Context: postmaster
Restart: true
Values: [always, on, off]

When archive_mode is enabled, completed WAL segments are sent to archive storage by setting archive_command or archive_library. In addition to off, to disable, there are two modes: on, and always. During normal operation, there is no difference between the two modes, but when set to always the WAL archiver is enabled also during archive recovery or standby mode. In always mode, all files restored from the archive or streamed with streaming replication will be archived (again). See continuous-archiving-in-standby for details.

archive_mode is a separate setting from archive_command and archive_library so that archive_command and archive_library can be changed without leaving archiving mode. This parameter can only be set at server start. archive_mode cannot be enabled when wal_level is set to minimal.

Recommendations

Requires a restart to change, so if you want to turn archiving on and off, set this to 'on' and change archive_command instead. Even better, set archive_command to a script which can be disabled by trigger or ENV variable.

Comments