GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • About
  • Download
  • Documentation
  • Community
  • Developers
  • Support
  • Donate
  • Your account

This view

  • Original page
  • New address

GeezerVison is showing www.postgresql.org — Chapter 51. Archive Modules

November 19, 2026: PostgreSQL 19 Released!
Documentation → PostgreSQL 16
Supported Versions: Current (19) / 18 / 17 / 16 / 15
Development Versions: devel
Chapter 51. Archive Modules
Prev  Up Part V. Server Programming Home  Next

Chapter 51. Archive Modules

Table of Contents

51.1. Initialization Functions
51.2. Archive Module Callbacks
51.2.1. Startup Callback
51.2.2. Check Callback
51.2.3. Archive Callback
51.2.4. Shutdown Callback

PostgreSQL provides infrastructure to create custom modules for continuous archiving (see Section 26.3). While archiving via a shell command (i.e., archive_command) is much simpler, a custom archive module will often be considerably more robust and performant.

When a custom archive_library is configured, PostgreSQL will submit completed WAL files to the module, and the server will avoid recycling or removing these WAL files until the module indicates that the files were successfully archived. It is ultimately up to the module to decide what to do with each WAL file, but many recommendations are listed at Section 26.3.1.

Archiving modules must at least consist of an initialization function (see Section 51.1) and the required callbacks (see Section 51.2). However, archive modules are also permitted to do much more (e.g., declare GUCs and register background workers).

The contrib/basic_archive module contains a working example, which demonstrates some useful techniques.


Prev  Up  Next
Chapter 50. Replication Progress Tracking  Home  51.1. Initialization Functions

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.