basic_archive
basic_archive
basic_archive : an example of an archive module
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5940 | basic_archive | basic_archive | - | ADMIN | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s---- | No | Yes | No | No | no | no |
| Relationships | |
|---|---|
| See Also | basebackup_to_shell pg_walinspect pg_repack pg_rewrite pg_squeeze pg_dirtyread pgfincore pg_cooldown |
Packages
| PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|
- | - | - | - | N/A |
This is a built-in contrib extension ship with the PostgreSQL kernel
Install
This extension does not need CREATE EXTENSION DDL command
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
Last updated on