バージョンごとのドキュメント一覧

第51章 アーカイブモジュール

目次

51.1. 初期化関数
51.2. アーカイブモジュールコールバック
51.2.1. スタートアップコールバック
51.2.2. チェックコールバック
51.2.3. アーカイブコールバック
51.2.4. シャットダウンコールバック
<title>Archive Modules</title>

PostgreSQL provides infrastructure to create custom modules for continuous archiving (see <xref linkend="continuous-archiving"/>). While archiving via a shell command (i.e., <xref linkend="guc-archive-command"/>) is much simpler, a custom archive module will often be considerably more robust and performant. PostgreSQLは、継続的アーカイブのためのカスタムモジュールを作成するためのインフラストラクチャを提供します(26.3を参照)。 シェルコマンド(すなわちarchive_command)によるアーカイブは非常に簡単ですが、カスタムアーカイブモジュールはしばしば非常に堅牢でパフォーマンスが高いでしょう。

When a custom <xref linkend="guc-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 <xref linkend="backup-archiving-wal"/>. カスタムarchive_libraryが設定されている場合、PostgreSQLは完了したWALファイルをモジュールに送信します。 サーバは、モジュールがファイルが正常にアーカイブされたことを示すまで、これらのWALファイルの再利用や削除を回避します。 各WALファイルをどうするかは最終的にモジュール次第ですが、26.3.1には多くの推奨事項が記載されています。

Archiving modules must at least consist of an initialization function (see <xref linkend="archive-module-init"/>) and the required callbacks (see <xref linkend="archive-module-callbacks"/>). However, archive modules are also permitted to do much more (e.g., declare GUCs and register background workers). アーカイブモジュールは、少なくとも初期化関数(51.1を参照)と必要なコールバック(51.2を参照)で構成されている必要があります。 しかし、アーカイブモジュールはさらに多くのこと(GUCの宣言やバックグラウンドワーカーの登録など)も許可されています。

The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. contrib/basic_archiveモジュールには、いくつかの有用なテクニックを示す実用的な例が含まれています。