{"Entry":{"collection":"catalog","key":"pg_replication_slots","name":"pg_replication_slots","aliases":[],"metadata":{"changed_in":["9.5","9.6","10","13","14","16","17","18","19"],"changes":[{"added":[],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.3","order":false,"removed":[],"status":"added","to":"9.4","types":[]},{"added":["active_pid"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.4","listing":[],"order":false,"removed":[],"status":"changed","to":"9.5","types":[],"unlisted":[]},{"added":["confirmed_flush_lsn"],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.5","listing":[],"order":false,"removed":[],"status":"changed","to":"9.6","types":[],"unlisted":[]},{"added":["temporary"],"attributes":[],"description_changed":true,"descriptions":[],"from":"9.6","listing":[],"order":false,"removed":[],"status":"changed","to":"10","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[{"from":"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.","name":"restart_lsn","to":"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."}],"from":"10","listing":[],"order":false,"removed":[],"status":"reworded","to":"11","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":true,"descriptions":[],"from":"11","listing":[],"order":false,"removed":[],"status":"reworded","to":"12","types":[],"unlisted":[]},{"added":["wal_status","safe_wal_size"],"attributes":[],"description_changed":false,"descriptions":[{"from":"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.","name":"restart_lsn","to":"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."},{"from":"The slot type - physical or logical","name":"slot_type","to":"The slot type: physical or logical"}],"from":"12","listing":[],"order":false,"removed":[],"status":"changed","to":"13","types":[],"unlisted":[]},{"added":["two_phase"],"attributes":[],"description_changed":true,"descriptions":[],"from":"13","listing":[],"order":false,"removed":[],"status":"changed","to":"14","types":[],"unlisted":[]},{"added":["conflicting"],"attributes":[],"description_changed":false,"descriptions":[{"from":"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.","name":"confirmed_flush_lsn","to":"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."},{"from":"Availability of WAL files claimed by this slot. Possible values are:\n\nreserved means that the claimed files are within max_wal_size. extended means that max_wal_size is exceeded but the files are still retained, either by the replication slot or by wal_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 to reserved or extended. lost means that some required WAL files have been removed and this slot is no longer usable.\n\nThe last two states are seen only when max_slot_wal_keep_size is non-negative.","name":"wal_status","to":"Availability of WAL files claimed by this slot. Possible values are:\n\nreserved means that the claimed files are within max_wal_size. extended means that max_wal_size is exceeded but the files are still retained, either by the replication slot or by wal_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 typically occurs when max_slot_wal_keep_size is set to a non-negative value. This state can return to reserved or extended. lost means that this slot is no longer usable."}],"from":"15","listing":[],"order":false,"removed":[],"status":"changed","to":"16","types":[],"unlisted":[]},{"added":["inactive_since","invalidation_reason","failover","synced"],"attributes":[],"description_changed":true,"descriptions":[{"from":"True if this slot is currently actively being used","name":"active","to":"True if this slot is currently being streamed"},{"from":"The process ID of the session using this slot if the slot is currently actively being used. NULL if inactive.","name":"active_pid","to":"The process ID of the session streaming data for this slot. NULL if inactive."},{"from":"True if this logical slot conflicted with recovery (and so is now invalidated). Always NULL for physical slots.","name":"conflicting","to":"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."}],"from":"16","listing":[],"order":false,"removed":[],"status":"changed","to":"17","types":[],"unlisted":[]},{"added":["two_phase_at"],"attributes":[],"description_changed":false,"descriptions":[{"from":"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 (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. On standby, this is useful for slots that are being synced from a primary server (whose synced field is true) so they know when the slot stopped being synchronized.","name":"inactive_since","to":"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."},{"from":"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:\n\nwal_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 a wal_level sufficient to perform logical decoding. It is set only for logical slots.","name":"invalidation_reason","to":"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:\n\nwal_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 a wal_level sufficient to perform logical decoding. It is set only for logical slots. idle_timeout means that the slot has remained inactive longer than the configured idle_replication_slot_timeout duration."}],"from":"17","listing":[],"order":false,"removed":[],"status":"changed","to":"18","types":[],"unlisted":[]},{"added":["slotsync_skip_reason"],"attributes":[],"description_changed":false,"descriptions":[{"from":"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:\n\nwal_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 a wal_level sufficient to perform logical decoding. It is set only for logical slots. idle_timeout means that the slot has remained inactive longer than the configured idle_replication_slot_timeout duration.","name":"invalidation_reason","to":"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:\n\nwal_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 an effective_wal_level sufficient to perform logical decoding. It is set only for logical slots. idle_timeout means that the slot has remained inactive longer than the configured idle_replication_slot_timeout duration."}],"from":"18","listing":[],"order":false,"removed":[],"status":"changed","to":"19","types":[],"unlisted":[]}],"column_count":22,"content_hash":"933e18a16d7be6c5c2f62016dac262e2f7c929c849872f63e77dbb8722d04805","first_version":"9.4","imported_at":"2026-09-30T00:40:55.75507+08:00","kind":"view","last_version":"20","name":"pg_replication_slots","position":66,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"v","shared":false,"source_rev":"english-manuals:c02e922bf8059fae577ea4dded60eff7aee828b1dcb8fddf5a6e74b86ebaf73b","summary":"The pg_replication_slots view provides a listing of all replication slots that currently exist on the database cluster, along with their current state.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_replication_slots","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_replication_slots","SourceRevision":"english-manuals:c02e922bf8059fae577ea4dded60eff7aee828b1dcb8fddf5a6e74b86ebaf73b","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"A unique, cluster-wide identifier for the replication slot","description_zh":"","documented":true,"documented_name":"slot_name","hidden":false,"name":"slot_name","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":2,"description":"The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.","description_zh":"","documented":true,"documented_name":"plugin","hidden":false,"name":"plugin","not_null":false,"references":"","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":3,"description":"The slot type: physical or logical","description_zh":"","documented":true,"documented_name":"slot_type","hidden":false,"name":"slot_type","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":4,"description":"The OID of the database this slot is associated with, or null. Only logical slots have an associated database.","description_zh":"","documented":true,"documented_name":"datoid","hidden":false,"name":"datoid","not_null":false,"references":"pg_database.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":5,"description":"The name of the database this slot is associated with, or null. Only logical slots have an associated database.","description_zh":"","documented":true,"documented_name":"database","hidden":false,"name":"database","not_null":false,"references":"pg_database.datname","type":"name","type_modifier":-1,"type_oid":19},{"array_dimensions":0,"attnum":6,"description":"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.","description_zh":"","documented":true,"documented_name":"temporary","hidden":false,"name":"temporary","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":7,"description":"True if this slot is currently being streamed","description_zh":"","documented":true,"documented_name":"active","hidden":false,"name":"active","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":8,"description":"The process ID of the session streaming data for this slot. NULL if inactive.","description_zh":"","documented":true,"documented_name":"active_pid","hidden":false,"name":"active_pid","not_null":false,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":9,"description":"The oldest transaction that this slot needs the database to retain. VACUUM cannot remove tuples deleted by any later transaction.","description_zh":"","documented":true,"documented_name":"xmin","hidden":false,"name":"xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":10,"description":"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.","description_zh":"","documented":true,"documented_name":"catalog_xmin","hidden":false,"name":"catalog_xmin","not_null":false,"references":"","type":"xid","type_modifier":-1,"type_oid":28},{"array_dimensions":0,"attnum":11,"description":"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.","description_zh":"","documented":true,"documented_name":"restart_lsn","hidden":false,"name":"restart_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":12,"description":"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.","description_zh":"","documented":true,"documented_name":"confirmed_flush_lsn","hidden":false,"name":"confirmed_flush_lsn","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":13,"description":"Availability of WAL files claimed by this slot. Possible values are:\n\nreserved means that the claimed files are within max_wal_size. extended means that max_wal_size is exceeded but the files are still retained, either by the replication slot or by wal_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 typically occurs when max_slot_wal_keep_size is set to a non-negative value. This state can return to reserved or extended. lost means that this slot is no longer usable.","description_zh":"","documented":true,"documented_name":"wal_status","hidden":false,"name":"wal_status","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":14,"description":"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.","description_zh":"","documented":true,"documented_name":"safe_wal_size","hidden":false,"name":"safe_wal_size","not_null":false,"references":"","type":"int8","type_modifier":-1,"type_oid":20},{"array_dimensions":0,"attnum":15,"description":"True if the slot is enabled for decoding prepared transactions. Always false for physical slots.","description_zh":"","documented":true,"documented_name":"two_phase","hidden":false,"name":"two_phase","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":16,"description":"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.","description_zh":"","documented":true,"documented_name":"two_phase_at","hidden":false,"name":"two_phase_at","not_null":false,"references":"","type":"pg_lsn","type_modifier":-1,"type_oid":3220},{"array_dimensions":0,"attnum":17,"description":"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.","description_zh":"","documented":true,"documented_name":"inactive_since","hidden":false,"name":"inactive_since","not_null":false,"references":"","type":"timestamptz","type_modifier":-1,"type_oid":1184},{"array_dimensions":0,"attnum":18,"description":"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.","description_zh":"","documented":true,"documented_name":"conflicting","hidden":false,"name":"conflicting","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":19,"description":"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:\n\nwal_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 a wal_level sufficient to perform logical decoding. It is set only for logical slots. idle_timeout means that the slot has remained inactive longer than the configured idle_replication_slot_timeout duration.","description_zh":"","documented":true,"documented_name":"invalidation_reason","hidden":false,"name":"invalidation_reason","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":20,"description":"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.","description_zh":"","documented":true,"documented_name":"failover","hidden":false,"name":"failover","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":21,"description":"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.","description_zh":"","documented":true,"documented_name":"synced","hidden":false,"name":"synced","not_null":false,"references":"","type":"bool","type_modifier":-1,"type_oid":16}],"description":"The pg_replication_slots view provides a listing of all replication slots that currently exist on the database cluster, along with their current state.\n\nFor more on replication slots, see Section 26.2.6 and Chapter 47.","description_zh":"","doc":{"anchor":"id-1.10.5.24.5","file":"view-pg-replication-slots.html","lang":"en","sha256":"53d9749941756d81a0b2cdb9dfd520773e919a1c76cb6226737ef68aa5023a7d","slug":"18"},"kind":"view","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["slot_name","plugin","slot_type","datoid","database","temporary","active","active_pid","xmin","catalog_xmin","restart_lsn","confirmed_flush_lsn","wal_status","safe_wal_size","two_phase","two_phase_at","inactive_since","conflicting","invalidation_reason","failover","synced"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.5.24.5","file":"view-pg-replication-slots.html","lang":"en","sha256":"53d9749941756d81a0b2cdb9dfd520773e919a1c76cb6226737ef68aa5023a7d","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["slot_name","plugin","slot_type","datoid","database","temporary","active","active_pid","xmin","catalog_xmin","restart_lsn","confirmed_flush_lsn","wal_status","safe_wal_size","two_phase","two_phase_at","inactive_since","conflicting","invalidation_reason","failover","synced"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_replication_slots","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_replication_slots","Summary":"pg_replication_slots视图提供当前数据库集簇中所有复制槽及其当前状态的列表。\n\n有关复制槽的更多信息，请参见第 26.2.6 节和第 47 章。","BodyHTML":"\u003cp\u003epg_replication_slots视图提供当前数据库集簇中所有复制槽及其当前状态的列表。\n\n有关复制槽的更多信息，请参见第 26.2.6 节和第 47 章。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"394974ca7d6f1e10c570f74cb620bfae891ecc3f892862ca5982458db05e2b04","Payload":{"columns":[{"description_zh":"一个集簇范围内唯一的复制槽标识符","name":"slot_name","type":"name","zh_from":"doc"},{"description_zh":"包含该逻辑槽所用输出插件的共享对象的基础名称；物理槽为 NULL。","name":"plugin","type":"name","zh_from":"doc"},{"description_zh":"槽类型：physical 或 logical","name":"slot_type","type":"text","zh_from":"doc"},{"description_zh":"与该槽关联的数据库 OID，或为 NULL。只有逻辑槽才有关联数据库。","name":"datoid","type":"oid","zh_from":"doc"},{"description_zh":"与该槽关联的数据库名称，或为 NULL。只有逻辑槽才有关联数据库。","name":"database","type":"name","zh_from":"doc"},{"description_zh":"如果这是一个临时复制槽则为真。临时槽不会保存到磁盘，并会在出错时或会话结束时自动删除。","name":"temporary","type":"boolean","zh_from":"doc"},{"description_zh":"如果该槽当前正被用于流式传输则为真","name":"active","type":"boolean","zh_from":"doc"},{"description_zh":"为该槽流式传输数据的会话的进程 ID。NULL 表示不活动。","name":"active_pid","type":"integer","zh_from":"doc"},{"description_zh":"该槽要求数据库保留的最旧事务。VACUUM 不能移除由任何更晚事务删除的元组。","name":"xmin","type":"xid","zh_from":"doc"},{"description_zh":"该槽要求数据库保留的、影响系统目录的最旧事务。VACUUM 不能移除由任何更晚事务删除的目录元组。","name":"catalog_xmin","type":"xid","zh_from":"doc"},{"description_zh":"该槽的消费者仍可能需要的最旧 WAL 的地址（LSN），因此除非此 LSN 落后于当前 LSN 超过max_slot_wal_keep_size，否则在检查点期间不会被自动删除。如果该槽的 LSN 从未被保留，则为 NULL。","name":"restart_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"逻辑槽消费者已确认接收的数据所到达的地址（LSN）。在此 LSN 之前提交的事务所对应的数据将不再可用。物理槽为 NULL。","name":"confirmed_flush_lsn","type":"pg_lsn","zh_from":"doc"},{"description_zh":"该槽所声明需要的 WAL 文件的可用性。可能值为：","name":"wal_status","type":"text","zh_from":"doc"},{"description_zh":"还可以写入 WAL 的字节数，使该槽不至于进入“lost”状态。对于处于 lost 状态的槽，以及 max_slot_wal_keep_size 为 -1 时，该值为 NULL。","name":"safe_wal_size","type":"bigint","zh_from":"doc"},{"description_zh":"如果该槽启用了预备事务解码则为真。物理槽始终为假。","name":"two_phase","type":"boolean","zh_from":"doc"},{"description_zh":"自哪个地址（LSN）起启用预备事务解码。对于 two_phase 为假的逻辑槽，以及物理槽，该值为 NULL。","name":"two_phase_at","type":"pg_lsn","zh_from":"doc"},{"description_zh":"槽变为不活动的时间。如果当前正在从该槽流式传输数据，则为 NULL。如果该槽变为无效，该值将不再更新。对于从主库同步而来的备库逻辑槽（其 synced 字段为 true），inactive_since 表示槽同步（参见第 47.2.3 节）最近一次停止的时间。如果该槽始终保持同步，则为 NULL。这有助于跟踪备库上的槽同步何时被中断。","name":"inactive_since","type":"timestamp with time zone","zh_from":"doc"},{"description_zh":"如果该逻辑槽与恢复发生冲突（因此现已失效）则为真。当该列为真时，请检查 invalidation_reason 列以了解冲突原因。物理槽始终为 NULL。","name":"conflicting","type":"boolean","zh_from":"doc"},{"description_zh":"该槽失效的原因。逻辑槽和物理槽都可能设置该值。若该槽未失效，则为 NULL。可能值为：","name":"invalidation_reason","type":"text","zh_from":"doc"},{"description_zh":"如果这是一个允许同步到备库的逻辑槽则为真，这样逻辑复制就可以在故障切换后从新的主库恢复。物理槽始终为假。","name":"failover","type":"boolean","zh_from":"doc"},{"description_zh":"如果这是一个从主库同步而来的逻辑槽则为真。在热备上，synced 列为真的槽既不能用于逻辑解码，也不能手工删除。该列在主库上的值没有意义；主库上该列默认对所有槽都为假，但也可能（如果是由已提升的备库遗留）为真。","name":"synced","type":"boolean","zh_from":"doc"}],"description_zh":"pg_replication_slots视图提供当前数据库集簇中所有复制槽及其当前状态的列表。\n\n有关复制槽的更多信息，请参见第 26.2.6 节和第 47 章。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
