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

SYSTEM CATALOG · 系统目录

pg_subscription

The catalog pg_subscription contains all existing logical replication subscriptions. For more information about logical replication see Chapter 29. Unlike most system catalogs, pg_subscription is shared across all databases of a cluster: there is only one copy of pg_subscription per cluster, not one per database. Access to the column subconninfo is revoked from normal users, because it could contain plain-text passwords.

首次收录 PG 10最近收录 PG 19当前字段 18

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

字段结构 PostgreSQL 18

pg_subscription
字段 / COLUMN类型 / TYPE说明 / DESCRIPTION
oid oidNOT NULL Row identifier
subdbid oidNOT NULL OID of the database that the subscription resides in引用:pg_database.oid
subskiplsn pg_lsnNOT NULL Finish LSN of the transaction whose changes are to be skipped, if a valid LSN; otherwise 0/0.
subname nameNOT NULL Name of the subscription
subowner oidNOT NULL Owner of the subscription引用:pg_authid.oid
subenabled booleanNOT NULL文档原写法:bool If true, the subscription is enabled and should be replicating
subbinary booleanNOT NULL文档原写法:bool If true, the subscription will request that the publisher send data in binary format
substream "char"NOT NULL文档原写法:char Controls how to handle the streaming of in-progress transactions: f = disallow streaming of in-progress transactions, t = spill the changes of in-progress transactions to disk and apply at once after the transaction is committed on the publisher and received by the subscriber, p = apply changes directly using a parallel apply worker if available (same as t if no worker is available)
subtwophasestate "char"NOT NULL文档原写法:char State codes for two-phase mode: d = disabled, p = pending enablement, e = enabled
subdisableonerr booleanNOT NULL文档原写法:bool If true, the subscription will be disabled if one of its workers detects an error
subpasswordrequired booleanNOT NULL文档原写法:bool If true, the subscription will be required to specify a password for authentication
subrunasowner booleanNOT NULL文档原写法:bool If true, the subscription will be run with the permissions of the subscription owner
subfailover booleanNOT NULL文档原写法:bool If true, the associated replication slots (i.e. the main slot and the table synchronization slots) in the upstream database are enabled to be synchronized to the standbys
subconninfo textNOT NULL Connection string to the upstream database
subslotname name Name of the replication slot in the upstream database (also used for the local replication origin name); null represents NONE
subsynccommit textNOT NULL The synchronous_commit setting for the subscription's workers to use
subpublications text[]NOT NULL Array of subscribed publication names. These reference publications defined in the upstream database. For more on publications see Section 29.1.
suborigin text The origin value must be either none or any. The default is any. If none, the subscription will request the publisher to only send changes that don't have an origin. If any, the publisher sends changes regardless of their origin.

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

通用系统列 6

PostgreSQL 提供的系统属性,通常不在 SELECT * 中展开。单独保留,不与普通字段混算。

字段类型attnum
tableoidoid-6
cmaxcid-5
xmaxxid-4
cmincid-3
xminxid-2
ctidtid-1

字段演化矩阵

悬停查看字段类型
存在新增 / 类型或属性变化移除
字段 / COLUMN9.09.19.29.39.49.59.610111213141516171819
oid
subdbid
subname
subowner
subenabled
subconninfo
subslotname
subsynccommit
subpublications
subbinary
substream
subskiplsn
subtwophasestate
subdisableonerr
subpasswordrequired
subrunasowner
suborigin
subfailover
subretaindeadtuples
submaxretention
subretentionactive
subserver
subwalrcvtimeout

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

演化时间线

相邻大版本的变化

PostgreSQL 19 ← 18

+ subretaindeadtuples+ submaxretention+ subretentionactive+ subserver+ subwalrcvtimeout~ subconninfo: not_null: true → false2 处字段说明更新

PostgreSQL 18 ← 17

1 处字段说明更新

PostgreSQL 17 ← 16

+ subfailover2 处字段说明更新目录说明更新

PostgreSQL 16 ← 15

+ subpasswordrequired+ subrunasowner+ suborigin~ substream: boolean → "char"1 处字段说明更新

PostgreSQL 15 ← 14

+ subskiplsn+ subtwophasestate+ subdisableonerr

PostgreSQL 14 ← 13

+ subbinary+ substream4 处字段说明更新目录说明更新

PostgreSQL 13 ← 12

~ subslotname: not_null: true → false

PostgreSQL 12 ← 11

~ oid: 隐式列 → 常规列2 处字段说明更新目录说明更新

PostgreSQL 11 ← 10

目录说明更新

PostgreSQL 10 ← 9.6新增目录

+ oid+ subdbid+ subname+ subowner+ subenabled+ subconninfo+ subslotname+ subsynccommit+ subpublications

比较任意两个版本

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