Postgresql 中文操作指南

F.6. basic_archive — an example WAL archive module #

basic_archive 是存档模块的一个示例。此模块将已完成的 WAL 段文件复制到指定目录。这可能不是特别有用,但可以作为开发您自己的存档模块的起点。有关存档模块的更多信息,请参阅 Chapter 51

basic_archive is an example of an archive module. This module copies completed WAL segment files to the specified directory. This may not be especially useful, but it can serve as a starting point for developing your own archive module. For more information about archive modules, see Chapter 51.

为了运行,这个模块必须通过 archive_library 加载,并且 archive_mode 必须启用。

In order to function, this module must be loaded via archive_library, and archive_mode must be enabled.

F.6.1. Configuration Parameters #

  • basic_archive.archive_directory (string)

    • The directory where the server should copy WAL segment files. This directory must already exist. The default is an empty string, which effectively halts WAL archiving, but if archive_mode is enabled, the server will accumulate WAL segment files in the expectation that a value will soon be provided.

这些参数必须在 postgresql.conf 中设置。典型用法可能是:

These parameters must be set in postgresql.conf. Typical usage might be:

# postgresql.conf
archive_mode = 'on'
archive_library = 'basic_archive'
basic_archive.archive_directory = '/path/to/archive/directory'

F.6.2. Notes #

服务器崩溃可能会在归档目录中留下带有前缀 archtemp 的临时文件。建议在崩溃后重启服务器之前删除此类文件。在服务器运行时删除此类文件是安全的,只要它们与任何仍在进行的归档无关即可,但是用户在执行此操作时应格外小心。

Server crashes may leave temporary files with the prefix archtemp in the archive directory. It is recommended to delete such files before restarting the server after a crash. It is safe to remove such files while the server is running as long as they are unrelated to any archiving still in progress, but users should use extra caution when doing so.

F.6.3. Author #

内森·博萨特

Nathan Bossart