select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

SYSTEM CATALOGS / SYSTEM VIEWS

pg_replication_slots

Read PG 18 manual ↗

The pg_replication_slots view provides a listing of all replication slots that currently exist on the database cluster, along with their current state.

Kind
System views
Columns in this snapshot
21
Definition source
English manual

Columns 21

ColumnTypeDescription / reference
slot_namenameA unique, cluster-wide identifier for the replication slot
pluginnameThe base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.
slot_typetextThe slot type: physical or logical
datoidoidThe OID of the database this slot is associated with, or null. Only logical slots have an associated database.
pg_database.oid
databasenameThe name of the database this slot is associated with, or null. Only logical slots have an associated database.
pg_database.datname
temporaryboolTrue 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.
activeboolTrue if this slot is currently being streamed
active_pidint4The process ID of the session streaming data for this slot. NULL if inactive.
xminxidThe oldest transaction that this slot needs the database to retain. VACUUM cannot remove tuples deleted by any later transaction.
catalog_xminxidThe 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_lsnpg_lsnThe 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_lsnpg_lsnThe 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_statustextAvailability of WAL files claimed by this slot. Possible values are:
safe_wal_sizeint8The 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_phaseboolTrue if the slot is enabled for decoding prepared transactions. Always false for physical slots.
two_phase_atpg_lsnThe 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_sincetimestamptzThe 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.
conflictingboolTrue 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_reasontextThe 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:
failoverboolTrue 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.
syncedboolTrue 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.
Column history across versions
Version history 12
  1. PG 18 → 19changed
  2. PG 17 → 18changed
  3. PG 16 → 17changed
  4. PG 15 → 16changed
  5. PG 13 → 14changed
  6. PG 12 → 13changed
  7. PG 11 → 12changed
  8. PG 10 → 11changed
  9. PG 9.6 → 10changed
  10. PG 9.5 → 9.6changed
  11. PG 9.4 → 9.5changed
  12. PG 9.3 → 9.4added

Definition snapshot: english-manuals:164d3b13354fb89a2dd83f10984… · English manual source