Supported Versions: Current (12) / 11 / 10 / 9.6 / 9.5
Development Versions: 13 / devel
Unsupported versions: 9.4
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the supported versions listed above instead.

51.80. 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 48.

Table 51.81. pg_replication_slots Columns

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 (references pg_database.oid)

The OID of the database this slot is associated with, or null. Only logical slots have an associated database.

database name (references pg_database.datname)

The name of the database this slot is associated with, or null. Only logical slots have an associated database.

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.

active bool

True if this slot is currently actively being used

active_pid int4

The process ID of the session using this slot if the slot is currently actively being used. 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. 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 older than this is not available anymore. NULL for physical slots.

wal_status text

Availability of WAL files claimed by this slot. Possible values are:

  • normal means that the claimed files are within max_wal_size.

  • reserved means that max_wal_size is exceeded but the files are still held, either by some replication slot or by wal_keep_segments.

  • lost means that some WAL files are definitely lost and this slot cannot be used to resume replication anymore.

The last two states are seen only when max_slot_wal_keep_size is non-negative. If restart_lsn is NULL, this field is null.

min_safe_lsn pg_lsn

The minimum LSN currently available for walsenders.