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

52.19. pg_replication_slots #

The <structname>pg_replication_slots</structname> view provides a listing of all replication slots that currently exist on the database cluster, along with their current state. pg_replication_slotsは、現在存在するデータベースクラスタとその状態、全てのレプリケーションスロットの一覧を提供します。

For more on replication slots, see <xref linkend="streaming-replication-slots"/> and <xref linkend="logicaldecoding"/>. レプリケーションスロットに関する詳細は、26.2.6第47章を参照してください。

表52.19 pg_replication_slotsの列

<title><structname>pg_replication_slots</structname> Columns</title>

Column Type 列 型

Description 説明

slot_name name

A unique, cluster-wide identifier for the replication slot クラスタ間で一意なレプリケーションスロットの識別子

plugin name

The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots. 出力プラグインに使用されている論理スロットまたは物理スロットの場合はNULL、を含む共有オブジェクトの基底名。

slot_type text

The slot type: <literal>physical</literal> or <literal>logical</literal> スロットのタイプ:physicalまたはlogical

datoid oid (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>oid</structfield>) (参照先 pg_database.oid

The OID of the database this slot is associated with, or null. Only logical slots have an associated database. このスロットと関連しているデータベースのOID、またはNULL。論理スロットだけがデータベースと関連を持つことができます。

database name (references <link linkend="catalog-pg-database"><structname>pg_database</structname></link>.<structfield>datname</structfield>) (参照先 pg_database.datname

The name of the database this slot is associated with, or null. Only logical slots have an associated database. このスロットと関連しているデータベース名、またはNULL。論理スロットだけがデータベースと関連を持つことができます。

temporary bool

True if this is a temporary replication slot. Temporary slots are not saved to disk and are automatically dropped on error or when the session has finished. trueの場合は、これが一時レプリケーションスロットである。 一時スロットはディスクに保存されず、エラーのとき、またはセッションが終了したときには自動的に削除されます。

active bool

True if this slot is currently actively being used trueの場合は、このスロットが現在アクティブで使用されている

active_pid int4

The process ID of the session using this slot if the slot is currently actively being used. <literal>NULL</literal> if inactive. このスロットが現在アクティブで使用されている場合は、スロットを使用しているセッションのプロセスID。アクティブでなければNULL

xmin xid

The oldest transaction that this slot needs the database to retain. <literal>VACUUM</literal> cannot remove tuples deleted by any later transaction. このスロットがデータベースとの接続を必要としている最も古いトランザクション。 VACUUM は後でトランザクションによって削除されたタプルを除去できません。

catalog_xmin xid

The oldest transaction affecting the system catalogs that this slot needs the database to retain. <literal>VACUUM</literal> cannot remove catalog tuples deleted by any later transaction. このスロットがデータベースとの接続を必要としている、システムカタログに影響する最も古いトランザクション。 VACUUMは後でトランザクションによって削除されたカタログのタプルを除去できません。

restart_lsn pg_lsn

The address (<literal>LSN</literal>) of oldest WAL which still might be required by the consumer of this slot and thus won't be automatically removed during checkpoints unless this LSN gets behind more than <xref linkend="guc-max-slot-wal-keep-size"/> from the current LSN. <literal>NULL</literal> if the <literal>LSN</literal> of this slot has never been reserved. 消費者のスロットによって必要とされており、LSNが現在のLSNからmax_slot_wal_keep_size以上遅れていない限り、チェックポイント中に自動的に削除されない最も古いWALのアドレス(LSN)です。 このスロットのLSNが保存されていなければNULLです。

confirmed_flush_lsn pg_lsn

The address (<literal>LSN</literal>) up to which the logical slot's consumer has confirmed receiving data. Data corresponding to the transactions committed before this <literal>LSN</literal> is not available anymore. <literal>NULL</literal> for physical slots. 利用者がデータの受信を確認できている論理スロットのアドレス(LSN)。 このLSNより前にコミットされたトランザクションに対応するデータは、もはや有効ではありません。 物理スロットの場合はNULL

wal_status text

Availability of WAL files claimed by this slot. Possible values are: このスロットが報告するWALファイルの入手可能性。 可能な値は以下です。

  • <para><literal>reserved</literal> means that the claimed files are within <varname>max_wal_size</varname>.</para>

    reserved。報告されたファイルはmax_wal_size内であることを意味します。

  • <para><literal>extended</literal> means that <varname>max_wal_size</varname> is exceeded but the files are still retained, either by the replication slot or by <varname>wal_keep_size</varname>.

    extendedmax_wal_sizeは超えているものの、ファイルはレプリケーションスロットあるいはwal_keep_sizeによって保存されていることを意味します。

  • <literal>unreserved</literal> means that the slot no longer retains the required WAL files and some of them are to be removed at the next checkpoint. This state can return to <literal>reserved</literal> or <literal>extended</literal>. unreserved。そのスロットはもはや要求されたWALファイルが保存されず、次のチェックポイントでそのうちいくつかは削除される予定であることを意味します。 この状態はreservedまたはextendedに戻すことができます。

  • <literal>lost</literal> means that some required WAL files have been removed and this slot is no longer usable. lost。必要なWALファイルの一部が削除されており、このスロットはもはや利用可能ではないことを意味します。

The last two states are seen only when <xref linkend="guc-max-slot-wal-keep-size"/> is non-negative. If <structfield>restart_lsn</structfield> is NULL, this field is null. 最後の2つの状態は、max_slot_wal_keep_sizeが非負の場合にのみ起こります。 restart_lsnがNULLなら、このフィールドはNULLです。

safe_wal_size int8

The number of bytes that can be written to WAL such that this slot is not in danger of getting in state "lost". It is NULL for lost slots, as well as if <varname>max_slot_wal_keep_size</varname> is <literal>-1</literal>. 「ロスト」状態に陥る危険性のないスロットにおいて、WALに書き込むことのできるバイト数です。 失われたスロットに対して、あるいはmax_slot_wal_keep_size-1ならNULLです。

two_phase bool

True if the slot is enabled for decoding prepared transactions. Always false for physical slots. trueの場合は、準備されたトランザクションのデコーディングのためにスロットが有効。 物理スロットでは常にfalse。

inactive_since timestamptz

The time since the slot has become inactive. <literal>NULL</literal> if the slot is currently being used. Note that for slots on the standby that are being synced from a primary server (whose <structfield>synced</structfield> field is <literal>true</literal>), the <structfield>inactive_since</structfield> indicates the last synchronization (see <xref linkend="logicaldecoding-replication-slots-synchronization"/>) time. スロットが非アクティブになってからの時間。 スロットが現在使用されている場合はNULL。 プライマリサーバから同期されているスタンバイ上のスロット(syncedフィールドがtrueのスロット)については、inactive_sinceは最後の同期(47.2.3を参照)時間を示します。

conflicting bool

True if this logical slot conflicted with recovery (and so is now invalidated). When this column is true, check <structfield>invalidation_reason</structfield> column for the conflict reason. Always NULL for physical slots. trueの場合は、この論理スロットがリカバリと競合した(したため、無効になっている)。 この列がtrueの場合、競合理由をinvalidation_reason列で確認してください。 物理スロットでは常にNULL。

invalidation_reason text

The reason for the slot's invalidation. It is set for both logical and physical slots. <literal>NULL</literal> if the slot is not invalidated. Possible values are: スロットが無効化された理由。 論理スロットと物理スロットの両方で設定されます。 スロットが無効化されない場合はNULL。 指定可能な値は以下のとおりです。

  • <literal>wal_removed</literal> means that the required WAL has been removed. wal_removedは、必要なWALが削除されたことを意味します。

  • <literal>rows_removed</literal> means that the required rows have been removed. It is set only for logical slots. rows_removedは、必要な行が削除されたことを意味します。 これは論理スロットに対してのみ設定されます。

  • <literal>wal_level_insufficient</literal> means that the primary doesn't have a <xref linkend="guc-wal-level"/> sufficient to perform logical decoding. It is set only for logical slots. wal_level_insufficientは、プライマリがロジカルデコーディングを実行するのに十分なwal_levelを持っていないことを意味します。 これは論理スロットに対してのみ設定されます。

failover bool

True if this is a logical slot enabled to be synced to the standbys so that logical replication can be resumed from the new primary after failover. Always false for physical slots. trueの場合は、この論理スロットがスタンバイに同期されるように有効になっており、フェイルオーバー後の新しいプライマリから論理レプリケーションを再開できます。 物理スロットの場合は、常にfalse。

synced bool

True if this is a logical slot that was synced from a primary server. On a hot standby, the slots with the synced column marked as true can neither be used for logical decoding nor dropped manually. The value of this column has no meaning on the primary server; the column value on the primary is default false for all slots but may (if leftover from a promoted standby) also be true. trueの場合は、これがプライマリサーバから同期された論理スロットです。 ホットスタンバイでは、同期されたカラムがtrueとマークされているスロットは、ロジカルデコーディングにも手動でドロップすることもできません。 この列の値はプライマリサーバでは意味を持ちません。 プライマリの列の値は、すべてのスロットに対してfalseですが、(昇格したスタンバイから残っている場合)trueになる場合もあります。