| 1 |
<!-- doc/src/sgml/basic-archive.sgml --> |
| 2 |
|
| 3 |
<sect1 id="basic-archive" xreflabel="basic_archive"> |
| 4 |
<title>basic_archive — an example WAL archive module</title> |
| 5 |
|
| 6 |
<indexterm zone="basic-archive"> |
| 7 |
<primary>basic_archive</primary> |
| 8 |
</indexterm> |
| 9 |
|
| 10 |
<para> |
| 11 |
<filename>basic_archive</filename> is an example of an archive module. This |
| 12 |
module copies completed WAL segment files to the specified directory. This |
| 13 |
may not be especially useful, but it can serve as a starting point for |
| 14 |
developing your own archive module. For more information about archive |
| 15 |
modules, see <xref linkend="archive-modules"/>. |
| 16 |
</para> |
| 17 |
|
| 18 |
<para> |
| 19 |
In order to function, this module must be loaded via |
| 20 |
<xref linkend="guc-archive-library"/>, and <xref linkend="guc-archive-mode"/> |
| 21 |
must be enabled. |
| 22 |
</para> |
| 23 |
|
| 24 |
<sect2 id="basic-archive-configuration-parameters"> |
| 25 |
<title>Configuration Parameters</title> |
| 26 |
|
| 27 |
<variablelist> |
| 28 |
<varlistentry> |
| 29 |
<term> |
| 30 |
<varname>basic_archive.archive_directory</varname> (<type>string</type>) |
| 31 |
<indexterm> |
| 32 |
<primary><varname>basic_archive.archive_directory</varname> configuration parameter</primary> |
| 33 |
</indexterm> |
| 34 |
</term> |
| 35 |
<listitem> |
| 36 |
<para> |
| 37 |
The directory where the server should copy WAL segment files. This |
| 38 |
directory must already exist. The default is an empty string, which |
| 39 |
effectively halts WAL archiving, but if <xref linkend="guc-archive-mode"/> |
| 40 |
is enabled, the server will accumulate WAL segment files in the |
| 41 |
expectation that a value will soon be provided. |
| 42 |
</para> |
| 43 |
</listitem> |
| 44 |
</varlistentry> |
| 45 |
</variablelist> |
| 46 |
|
| 47 |
<para> |
| 48 |
These parameters must be set in <filename>postgresql.conf</filename>. |
| 49 |
Typical usage might be: |
| 50 |
</para> |
| 51 |
|
| 52 |
<programlisting> |
| 53 |
# postgresql.conf |
| 54 |
archive_mode = 'on' |
| 55 |
archive_library = 'basic_archive' |
| 56 |
basic_archive.archive_directory = '/path/to/archive/directory' |
| 57 |
</programlisting> |
| 58 |
</sect2> |
| 59 |
|
| 60 |
<sect2 id="basic-archive-notes"> |
| 61 |
<title>Notes</title> |
| 62 |
|
| 63 |
<para> |
| 64 |
Server crashes may leave temporary files with the prefix |
| 65 |
<filename>archtemp</filename> in the archive directory. It is recommended to |
| 66 |
delete such files before restarting the server after a crash. It is safe to |
| 67 |
remove such files while the server is running as long as they are unrelated |
| 68 |
to any archiving still in progress, but users should use extra caution when |
| 69 |
doing so. |
| 70 |
</para> |
| 71 |
</sect2> |
| 72 |
|
| 73 |
<sect2 id="basic-archive-author"> |
| 74 |
<title>Author</title> |
| 75 |
|
| 76 |
<para> |
| 77 |
Nathan Bossart |
| 78 |
</para> |
| 79 |
</sect2> |
| 80 |
|
| 81 |
</sect1> |