|The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide
by The PostgreSQL Global Development Group
Paperback (6"x9"), 274 pages
RRP £9.95 ($14.95)
Sales of this book support the PostgreSQL project! Get a printed copy>>>
archive_modeis enabled, completed WAL segments are sent to archive storage by setting
archive_commandare separate variables so that
archive_commandcan be changed without leaving archiving mode. This parameter can only be set at server start.
wal_levelmust be set to
The shell command to execute to archive a completed WAL file
%pin the string is replaced by the path name of the file to archive, and any
%fis replaced by only the file name. (The path name is relative to the working directory of the server, i.e., the cluster's data directory.) Use
%%to embed an actual
%character in the command. It is important for the command to return a zero exit status only if it succeeds. For more information see section 10.3.1 Setting up WAL archiving. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line. It is ignored unless
archive_modewas enabled at server start. If
archive_commandis an empty string (the default) while
archive_modeis enabled, WAL archiving is temporarily disabled, but the server continues to accumulate WAL segment files in the expectation that a command will soon be provided. Setting
archive_commandto a command that does nothing but return true, e.g.
REMon Windows), effectively disables archiving, but also breaks the chain of WAL files needed for archive recovery, so it should only be used in unusual circumstances.
archive_commandis only invoked for completed WAL segments. Hence, if your server generates little WAL traffic (or has slack periods where it does so), there could be a long delay between the completion of a transaction and its safe recording in archive storage. To limit how old unarchived data can be, you can set
archive_timeoutto force the server to switch to a new WAL segment file periodically. When this parameter is greater than zero, the server will switch to a new segment file whenever this many seconds have elapsed since the last segment file switch, and there has been any database activity, including a single checkpoint. (Increasing
checkpoint_timeoutwill reduce unnecessary checkpoints on an idle system.) Note that archived files that are closed early due to a forced switch are still the same length as completely full files. Therefore, it is unwise to use a very short
archive_timeout---it will bloat your archive storage.
archive_timeoutsettings of a minute or so are usually reasonable. This parameter can only be set in the ‘postgresql.conf’ file or on the server command line.
|ISBN 9781906966072||The PostgreSQL 9.0 Reference Manual - Volume 3 - Server Administration Guide||See the print edition|