跳转到主要内容
← 目录图谱 / pg_replication_slots

SYSTEM VIEW · 系统视图

pg_replication_slots

The pg_replication_slots view provides a listing of all replication slots that currently exist on the database cluster, along with their current state. For more on replication slots, see Section 26.2.6 and Chapter 47.

首次收录 PG 9.4最近收录 PG 19当前字段 21

已与 PostgreSQL 18.6 实例逐字段核对 · 原始实测记录 ↗

字段结构 PostgreSQL 18

pg_replication_slots
字段 / 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.
slot_type text The slot type: physical or logical
datoid oid The OID of the database this slot is associated with, or null. Only logical slots have an associated database.引用:pg_database.oid
database name The name of the database this slot is associated with, or null. Only logical slots have an associated database.引用:pg_database.datname
temporary boolean文档原写法: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.
active boolean文档原写法:bool True if this slot is currently being streamed
active_pid integer文档原写法:int4 The process ID of the session streaming data for this slot. NULL if inactive.
xmin xid The oldest transaction that this slot needs the database to retain. VACUUM cannot remove tuples deleted by any later transaction.
catalog_xmin xid The oldest transaction affecting the system catalogs that this slot needs the database to retain. VACUUM cannot remove catalog tuples deleted by any later transaction.
restart_lsn pg_lsn The address (LSN) 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 max_slot_wal_keep_size from the current LSN. NULL if the LSN of this slot has never been reserved.
confirmed_flush_lsn pg_lsn The address (LSN) up to which the logical slot's consumer has confirmed receiving data. Data corresponding to the transactions committed before this LSN is not available anymore. NULL for physical slots.
wal_status text Availability of WAL files claimed by this slot. Possible values are:
safe_wal_size bigint文档原写法: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 max_slot_wal_keep_size is -1.
two_phase boolean文档原写法:bool True if the slot is enabled for decoding prepared transactions. Always false for physical slots.
two_phase_at pg_lsn The address (LSN) from which the decoding of prepared transactions is enabled. NULL for logical slots where two_phase is false and for physical slots.
inactive_since timestamp with time zone文档原写法:timestamptz The time when the slot became inactive. NULL if the slot is currently being streamed. If the slot becomes invalid, this value will never be updated. For standby slots that are being synced from a primary server (whose synced field is true), the inactive_since indicates the time when slot synchronization (see Section 47.2.3) was most recently stopped. NULL if the slot has always been synchronized. This helps standby slots track when synchronization was interrupted.
conflicting boolean文档原写法:bool True if this logical slot conflicted with recovery (and so is now invalidated). When this column is true, check invalidation_reason column for the conflict reason. Always NULL for physical slots.
invalidation_reason text The reason for the slot's invalidation. It is set for both logical and physical slots. NULL if the slot is not invalidated. Possible values are:
failover boolean文档原写法: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.
synced boolean文档原写法: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.

标记“隐式列”的字段不包含在 SELECT * 中;部分早期统计视图由同版本源码补全,额外来源会显示在字段说明中。

字段演化矩阵

悬停查看字段类型
存在新增 / 类型或属性变化移除
字段 / COLUMN9.09.19.29.39.49.59.610111213141516171819
slot_name
plugin
slot_type
datoid
database
active
xmin
catalog_xmin
restart_lsn
active_pid
confirmed_flush_lsn
temporary
wal_status
safe_wal_size
two_phase
conflicting
inactive_since
invalidation_reason
failover
synced
two_phase_at
slotsync_skip_reason

9.0 是收录基线;基线中已存在的字段不标记为新增。矩阵按字段名称对齐,重命名显示为旧字段移除与新字段新增。

演化时间线

相邻大版本的变化

PostgreSQL 19 ← 18

+ slotsync_skip_reason

PostgreSQL 18 ← 17

+ two_phase_at1 处字段说明更新

PostgreSQL 17 ← 16

+ inactive_since+ invalidation_reason+ failover+ synced3 处字段说明更新目录说明更新

PostgreSQL 16 ← 15

+ conflicting2 处字段说明更新

PostgreSQL 14 ← 13

+ two_phase目录说明更新

PostgreSQL 13 ← 12

+ wal_status+ safe_wal_size2 处字段说明更新

PostgreSQL 12 ← 11

目录说明更新

PostgreSQL 11 ← 10

1 处字段说明更新目录说明更新

PostgreSQL 10 ← 9.6

+ temporary目录说明更新

PostgreSQL 9.6 ← 9.5

+ confirmed_flush_lsn目录说明更新

PostgreSQL 9.5 ← 9.4

+ active_pid

PostgreSQL 9.4 ← 9.3新增目录

+ slot_name+ plugin+ slot_type+ datoid+ database+ active+ xmin+ catalog_xmin+ restart_lsn

比较任意两个版本

选择两个版本,查看字段的新增、移除与类型变化。交互比较需要 JavaScript;演化时间线可直接阅读。