]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/archive-modules.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / archive-modules.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 49. Archive Modules</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="replication-origins.html" title="Chapter 48. Replication Progress Tracking" /><link rel="next" href="archive-module-init.html" title="49.1. Initialization Functions" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 49. Archive Modules</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="replication-origins.html" title="Chapter 48. Replication Progress Tracking">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="server-programming.html" title="Part V. Server Programming">Up</a></td><th width="60%" align="center">Part V. Server Programming</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="archive-module-init.html" title="49.1. Initialization Functions">Next</a></td></tr></table><hr /></div><div class="chapter" id="ARCHIVE-MODULES"><div class="titlepage"><div><div><h2 class="title">Chapter 49. Archive Modules</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="archive-module-init.html">49.1. Initialization Functions</a></span></dt><dt><span class="sect1"><a href="archive-module-callbacks.html">49.2. Archive Module Callbacks</a></span></dt><dd><dl><dt><span class="sect2"><a href="archive-module-callbacks.html#ARCHIVE-MODULE-STARTUP">49.2.1. Startup Callback</a></span></dt><dt><span class="sect2"><a href="archive-module-callbacks.html#ARCHIVE-MODULE-CHECK">49.2.2. Check Callback</a></span></dt><dt><span class="sect2"><a href="archive-module-callbacks.html#ARCHIVE-MODULE-ARCHIVE">49.2.3. Archive Callback</a></span></dt><dt><span class="sect2"><a href="archive-module-callbacks.html#ARCHIVE-MODULE-SHUTDOWN">49.2.4. Shutdown Callback</a></span></dt></dl></dd></dl></div><a id="id-1.8.16.2" class="indexterm"></a><p>
3   PostgreSQL provides infrastructure to create custom modules for continuous
4   archiving (see <a class="xref" href="continuous-archiving.html" title="25.3. Continuous Archiving and Point-in-Time Recovery (PITR)">Section 25.3</a>).  While archiving via
5   a shell command (i.e., <a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-COMMAND">archive_command</a>) is much
6   simpler, a custom archive module will often be considerably more robust and
7   performant.
8  </p><p>
9   When a custom <a class="xref" href="runtime-config-wal.html#GUC-ARCHIVE-LIBRARY">archive_library</a> is configured, PostgreSQL
10   will submit completed WAL files to the module, and the server will avoid
11   recycling or removing these WAL files until the module indicates that the files
12   were successfully archived.  It is ultimately up to the module to decide what
13   to do with each WAL file, but many recommendations are listed at
14   <a class="xref" href="continuous-archiving.html#BACKUP-ARCHIVING-WAL" title="25.3.1. Setting Up WAL Archiving">Section 25.3.1</a>.
15  </p><p>
16   Archiving modules must at least consist of an initialization function (see
17   <a class="xref" href="archive-module-init.html" title="49.1. Initialization Functions">Section 49.1</a>) and the required callbacks (see
18   <a class="xref" href="archive-module-callbacks.html" title="49.2. Archive Module Callbacks">Section 49.2</a>).  However, archive modules are
19   also permitted to do much more (e.g., declare GUCs and register background
20   workers).
21  </p><p>
22   The <code class="filename">contrib/basic_archive</code> module contains a working
23   example, which demonstrates some useful techniques.
24  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="replication-origins.html" title="Chapter 48. Replication Progress Tracking">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="server-programming.html" title="Part V. Server Programming">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="archive-module-init.html" title="49.1. Initialization Functions">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 48. Replication Progress Tracking </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 49.1. Initialization Functions</td></tr></table></div></body></html>