basic_archive
an example of an archive module
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
basic_archive | - | ADMIN | PostgreSQL | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5940 | basic_archive | No | Yes | No | No | No | No | - |
| Related | basebackup_to_shell pg_walinspect pg_repack pg_rewrite pg_squeeze pg_dirtyread pgfincore pg_cooldown |
|---|
Version
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
| - | - | - | - | ✗ |
Install
Note: This is a built-in contrib extension of PostgreSQL
Usage
The basic_archive module is a WAL archive module that copies completed WAL segment files to a specified directory. It serves as a reference implementation for custom archive modules.
Configuration
Add to postgresql.conf:
archive_mode = 'on'
archive_library = 'basic_archive'
basic_archive.archive_directory = '/path/to/archive/directory'
Parameters
| Parameter | Type | Description |
|---|---|---|
basic_archive.archive_directory | string | Directory to copy WAL files to (must already exist) |
If archive_mode is enabled but basic_archive.archive_directory is empty (default), the server will accumulate WAL files until a directory path is configured.
Notes
- The target directory must be created before use; the module will not create it
- After a server crash, temporary files with the
archtempprefix may be left in the archive directory and should be deleted before restarting - These temporary files can also be safely removed while the server is running, provided they are not related to an ongoing archive operation
- This module is primarily intended as a simple example and starting point for developing custom archive modules
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.