2 Chapter 49. Archive Modules
6 49.1. Initialization Functions
7 49.2. Archive Module Callbacks
9 49.2.1. Startup Callback
10 49.2.2. Check Callback
11 49.2.3. Archive Callback
12 49.2.4. Shutdown Callback
14 PostgreSQL provides infrastructure to create custom modules for
15 continuous archiving (see Section 25.3). While archiving via a shell
16 command (i.e., archive_command) is much simpler, a custom archive
17 module will often be considerably more robust and performant.
19 When a custom archive_library is configured, PostgreSQL will submit
20 completed WAL files to the module, and the server will avoid recycling
21 or removing these WAL files until the module indicates that the files
22 were successfully archived. It is ultimately up to the module to decide
23 what to do with each WAL file, but many recommendations are listed at
26 Archiving modules must at least consist of an initialization function
27 (see Section 49.1) and the required callbacks (see Section 49.2).
28 However, archive modules are also permitted to do much more (e.g.,
29 declare GUCs and register background workers).
31 The contrib/basic_archive module contains a working example, which
32 demonstrates some useful techniques.