51.2. Archive Module Callbacks
The archive callbacks define the actual archiving behavior of the module. The server will call them as required to process each individual WAL file.
check_configured_cbcallback is called to determine whether the module is fully configured and ready to accept WAL files (e.g., its configuration parameters are set to valid values). If no
check_configured_cbis defined, the server always assumes the module is configured.
typedef bool (*ArchiveCheckConfiguredCB) (void);
trueis returned, the server will proceed with archiving the file by calling the
falseis returned, archiving will not proceed, and the archiver will emit the following message to the server log:
WARNING: archive_mode enabled, yet archiving is not configured
In the latter case, the server will periodically call this function, and archiving will proceed only when it returns
archive_file_cbcallback is called to archive a single WAL file.
typedef bool (*ArchiveFileCB) (const char *file, const char *path);
trueis returned, the server proceeds as if the file was successfully archived, which may include recycling or removing the original WAL file. If
falseis returned, the server will keep the original WAL file and retry archiving later.
filewill contain just the file name of the WAL file to archive, while
pathcontains the full path of the WAL file (including the file name).
shutdown_cbcallback is called when the archiver process exits (e.g., after an error) or the value of archive_library changes. If no
shutdown_cbis defined, no special action is taken in these situations.
typedef void (*ArchiveShutdownCB) (void);