Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
52.19. pg_replication_slots
Prev UpChapter 52. System ViewsHome Next

52.19. pg_replication_slots#

Thepg_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, seeSection 25.2.6 andChapter 47.

Table 52.19. pg_replication_slots Columns

Column Type

Description

slot_namename

A unique, cluster-wide identifier for the replication slot

pluginname

The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.

slot_typetext

The slot type:physical orlogical

datoidoid (referencespg_database.oid)

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

databasename (referencespg_database.datname)

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

temporarybool

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.

activebool

True if this slot is currently being streamed

active_pidint4

The process ID of the session streaming data for this slot.NULL if inactive.

xminxid

The oldest transaction that this slot needs the database to retain.VACUUM cannot remove tuples deleted by any later transaction.

catalog_xminxid

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_lsnpg_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 thanmax_slot_wal_keep_size from the current LSN.NULL if theLSN of this slot has never been reserved.

confirmed_flush_lsnpg_lsn

The address (LSN) up to which the logical slot's consumer has confirmed receiving data. Data corresponding to the transactions committed before thisLSN is not available anymore.NULL for physical slots.

wal_statustext

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

  • reserved means that the claimed files are withinmax_wal_size.

  • extended means thatmax_wal_size is exceeded but the files are still retained, either by the replication slot or bywal_keep_size.

  • unreserved 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 toreserved orextended.

  • lost means that some required WAL files have been removed and this slot is no longer usable.

The last two states are seen only whenmax_slot_wal_keep_size is non-negative. Ifrestart_lsn is NULL, this field is null.

safe_wal_sizeint8

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 ifmax_slot_wal_keep_size is-1.

two_phasebool

True if the slot is enabled for decoding prepared transactions. Always false for physical slots.

inactive_sincetimestamptz

The time when the slot became inactive.NULL if the slot is currently being streamed. Note that for slots on the standby that are being synced from a primary server (whosesynced field istrue), theinactive_since indicates the time when slot synchronization (seeSection 47.2.3) was most recently stopped.NULL if the slot has always been synchronized. On standby, this is useful for slots that are being synced from a primary server (whosesynced field istrue) so they know when the slot stopped being synchronized.

conflictingbool

True if this logical slot conflicted with recovery (and so is now invalidated). When this column is true, checkinvalidation_reason column for the conflict reason. Always NULL for physical slots.

invalidation_reasontext

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:

  • wal_removed means that the required WAL has been removed.

  • rows_removed means that the required rows have been removed. It is set only for logical slots.

  • wal_level_insufficient means that the primary doesn't have awal_level sufficient to perform logical decoding. It is set only for logical slots.

failoverbool

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.

syncedbool

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.



Prev Up Next
52.18. pg_replication_origin_status Home 52.20. pg_roles
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp