SYSTEM CATALOG系统目录表
pg_subscription
逻辑复制订阅
系统目录表 引入 10 现存至 20 devel 7 次结构变更
版本轨迹
相对 PostgreSQL 17:描述更新 1 处。
目录pg_subscription包含所有现有的逻辑复制订阅。更多有关逻辑复制的信息请见Chapter 29。
和大部分系统目录不同,pg_subscription在集簇的所有数据库之间共享:每个集簇只有一份pg_subscription拷贝,而不是每个数据库一份。
对列subconninfo的访问被从普通用户那里收回,因为该列可能含有明文密码。
字段
PostgreSQL 18 的 18 个字段,按定义顺序排列。说明默认用本站手册的译文,没有译文的按英文原文显示。
| 字段 | 类型 | 说明 |
|---|---|---|
oid
|
oidNOT NULL
|
行标识符 |
subdbid
|
oidNOT NULL
pg_database.oid
|
订阅所在的数据库的OID |
subskiplsn
|
pg_lsnNOT NULL
|
事务的完成LSN,其更改将被跳过,如果是有效LSN;否则0/0。 |
subname
|
nameNOT NULL
|
订阅的名称 |
subowner
|
oidNOT NULL
pg_authid.oid
|
订阅的拥有者 |
subenabled
|
booleanNOT NULL
|
如果为真,订阅被启用并且应该被复制。 |
subbinary
|
booleanNOT NULL
|
如果为真,订阅将请求发布者以二进制格式发送数据。 |
substream
|
"char"NOT NULL
|
控制如何处理进行中事务的流式传输: f = 不允许对进行中事务进行流式传输, t = 将进行中事务的更改溢写到磁盘,并在事务在发布者端提交且被订阅者接收后立即应用, p = 如果可用,则直接使用并行应用工作进程应用更改(如果没有工作进程,则与 t 相同) |
subtwophasestate
|
"char"NOT NULL
|
两阶段模式的状态代码: d = 禁用, p = 待启用, e = 已启用 |
subdisableonerr
|
booleanNOT NULL
|
如果为真,则当某个工作进程检测到错误时,该订阅将被禁用 |
subpasswordrequired
|
booleanNOT NULL
|
如果为真,则订阅必须指定用于认证的密码 |
subrunasowner
|
booleanNOT NULL
|
如果为真,则订阅将按订阅所有者的权限运行 |
subfailover
|
booleanNOT NULL
|
如果为真,则会启用上游数据库中的相关复制槽(即主复制槽和表同步复制槽),使其能够同步到备库 |
subconninfo
|
textNOT NULL
|
到上游数据库的连接字符串 |
subslotname
|
name
|
上游数据库中复制槽的名称(也用于本地复制源名称);空表示 NONE |
subsynccommit
|
textNOT NULL
|
用于订阅工作者的synchronous_commit设置。 |
subpublications
|
text[]NOT NULL
|
被订阅的发布名称数组。它们引用的是上游数据库中定义的发布。 关于发布的更多信息见Section 29.1。 |
suborigin
|
text
|
来源值必须是 none 或 any 之一。默认值是 any。 如果为 none,订阅会请求发布者只发送没有来源的更改。 如果为 any,发布者会发送更改,而不管其来源如何。 |
演化历史
相邻两个大版本之间的差异,新的在前。版本号链到该版的字段表。
-
PostgreSQL 19 ← 18 结构变更
subretaindeadtuplessubmaxretentionsubretentionactivesubserversubwalrcvtimeoutsubconninfo:非空 → 可空2 处描述更新
subconninfoConnection string to the upstream database Connection string to the upstream database. NULL if subserver is nonzero.subskiplsnFinish LSN of the transaction whose changes are to be skipped, if a valid LSN; otherwise 0/0. Finish LSN of the transaction whose changes are to be skipped, if a valid LSN; otherwise 0/0000000.
-
PostgreSQL 18 ← 17 仅描述更新
1 处描述更新
subfailoverIf true, the associated replication slots (i.e. the main slot and the table sync slots) in the upstream database are enabled to be synchronized to the standbys 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
-
PostgreSQL 17 ← 16 结构变更
subfailover关系说明更新2 处描述更新
subpublicationsArray of subscribed publication names. These reference publications defined in the upstream database. For more on publications see Section 31.1. Array of subscribed publication names. These reference publications defined in the upstream database. For more on publications see Section 29.1.substreamControls 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) 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)
-
PostgreSQL 16 ← 15 结构变更
subpasswordrequiredsubrunasownersuboriginsubstream:boolean → "char"1 处描述更新
substreamIf true, the subscription will allow streaming of in-progress transactions 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)
-
PostgreSQL 15 ← 14 结构变更
subskiplsnsubtwophasestatesubdisableonerr -
PostgreSQL 14 ← 13 结构变更
subbinarysubstream关系说明更新4 处描述更新
subdbidOID of the database which the subscription resides in OID of the database that the subscription resides insubenabledIf true, the subscription is enabled and should be replicating. If true, the subscription is enabled and should be replicatingsubpublicationsArray of subscribed publication names. These reference the publications on the publisher server. For more on publications see Section 30.1. Array of subscribed publication names. These reference publications defined in the upstream database. For more on publications see Section 31.1.subsynccommitContains the value of the synchronous_commit setting for the subscription workers. The synchronous_commit setting for the subscription's workers to use
-
PostgreSQL 13 ← 12 结构变更
subslotname:非空 → 可空 -
PostgreSQL 12 ← 11 结构变更
oid:隐式列 → 常规列 关系说明更新2 处描述更新
oidRow identifier (hidden attribute; must be explicitly selected) Row identifiersubpublicationsArray of subscribed publication names. These reference the publications on the publisher server. For more on publications see Section 31.1. Array of subscribed publication names. These reference the publications on the publisher server. For more on publications see Section 30.1.
-
PostgreSQL 11 ← 10 仅描述更新
关系说明更新
-
PostgreSQL 10 ← 9.6 新增此关系
共 9 个字段
字段矩阵
每个字段在 11 个收录版本里的存在情况;方格指向该版的字段表。「有变」指类型、可空、隐式或数组维数与上一版不同。
存在 有变 已移除 不存在
| 字段 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|
oid |
存在 | 存在 | 有变 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subdbid |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subname |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subowner |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subenabled |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subconninfo |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 有变 | 存在 |
subslotname |
存在 | 存在 | 存在 | 有变 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subsynccommit |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subpublications |
存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subbinary |
不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
substream |
不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 有变 | 存在 | 存在 | 存在 | 存在 |
subskiplsn |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subtwophasestate |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subdisableonerr |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subpasswordrequired |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subrunasowner |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
suborigin |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 | 存在 |
subfailover |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 | 存在 | 存在 |
subretaindeadtuples |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 |
submaxretention |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 |
subretentionactive |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 |
subserver |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 |
subwalrcvtimeout |
不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 不存在 | 存在 | 存在 |
系统列
每张表都有的 6 个系统列
tableoidoid-6cmaxcid-5xmaxxid-4cmincid-3xminxid-2ctidtid-1
同类关系
| 关系 | 引入 | 字段 | 版本变动 | 最近变更 |
|---|---|---|---|---|
pg_aggregate |
9.0基线 | 22 | 113 次 | |
| 聚合函数 | 现存 | |||
pg_am |
9.0基线 | 4 | 124 次 | |
| 关系访问方法 | 现存 | |||
pg_amop |
9.0基线 | 9 | 122 次 | |
| 访问方法操作符 | 现存 | |||
pg_amproc |
9.0基线 | 6 | 121 次 | |
| 访问方法支持函数 | 现存 | |||
pg_attrdef |
9.0基线 | 4 | 122 次 | |
| 列默认值 | 现存 | |||
pg_attribute |
9.0基线 | 25 | 189 次 | |
| 表列(“属性”) | 现存 | |||
pg_auth_members |
9.0基线 | 7 | 161 次 | |
| 授权标识符成员关系 | 现存 | |||
pg_authid |
9.0基线 | 12 | 123 次 | |
| 授权标识符(角色) | 现存 | |||
pg_cast |
9.0基线 | 6 | 121 次 | |
| 转换(数据类型转换) | 现存 | |||
pg_class |
9.0基线 | 34 | 189 次 | |
| 表、索引、序列、视图 (“关系”) | 现存 | |||
pg_collation |
9.1 | 12 | 175 次 | |
| 排序规则(区域设置信息) | 现存 | |||
pg_constraint |
9.0基线 | 28 | 187 次 | |
| 检查约束、唯一约束、主键约束、外键约束 | 现存 | |||
pg_conversion |
9.0基线 | 8 | 121 次 | |
| 编码转换信息 | 现存 | |||
pg_database |
9.0基线 | 18 | 175 次 | |
| 本数据库集簇中的数据库 | 现存 | |||
pg_db_role_setting |
9.0基线 | 3 | — | |
| 每角色和每数据库的设置 | 现存 | |||
pg_default_acl |
9.0基线 | 5 | 121 次 | |
| 对象类型的默认权限 | 现存 | |||
pg_depend |
9.0基线 | 7 | — | |
| 数据库对象间的依赖 | 现存 | |||
pg_description |
9.0基线 | 4 | 9.51 次 | |
| 数据库对象上的描述或注释 | 现存 | |||
pg_enum |
9.0基线 | 4 | 122 次 | |
| 枚举标签和值定义 | 现存 | |||
pg_event_trigger |
9.3 | 7 | 121 次 | |
| 事件触发器 | 现存 | |||
pg_extension |
9.1 | 8 | 122 次 | |
| 已安装扩展 | 现存 | |||
pg_foreign_data_wrapper |
9.0基线 | 8 | 193 次 | |
| 外部数据包装器定义 | 现存 | |||
pg_foreign_server |
9.0基线 | 8 | 121 次 | |
| 外部服务器定义 | 现存 | |||
pg_foreign_table |
9.1 | 3 | — | |
| 外部表信息 | 现存 | |||
pg_index |
9.0基线 | 21 | 155 次 | |
| 索引信息 | 现存 | |||
pg_inherits |
9.0基线 | 4 | 141 次 | |
| 表继承层次 | 现存 | |||
pg_init_privs |
9.6 | 5 | — | |
| 对象初始权限 | 现存 | |||
pg_language |
9.0基线 | 9 | 121 次 | |
| 编写函数的语言 | 现存 | |||
pg_largeobject |
9.0基线 | 3 | 9.51 次 | |
| 大对象的数据页 | 现存 | |||
pg_largeobject_metadata |
9.0基线 | 3 | 121 次 | |
| 大对象的元数据 | 现存 | |||
pg_namespace |
9.0基线 | 4 | 121 次 | |
| 模式 | 现存 | |||
pg_opclass |
9.0基线 | 9 | 121 次 | |
| 访问方法操作符类 | 现存 | |||
pg_operator |
9.0基线 | 15 | 121 次 | |
| 操作符 | 现存 | |||
pg_opfamily |
9.0基线 | 5 | 121 次 | |
| 访问方法操作符族 | 现存 | |||
pg_parameter_acl |
15 | 3 | — | |
| 已授予权限的配置参数 | 现存 | |||
pg_partitioned_table |
10 | 8 | 111 次 | |
| 表的分区键的信息 | 现存 | |||
pg_pltemplate |
9.0基线 | 8 | 9.51 次 | |
| 过程语言的模板数据 | 于 13 移除 | |||
pg_policy |
9.5 | 8 | 122 次 | |
| 行安全策略 | 现存 | |||
pg_proc |
9.0基线 | 30 | 147 次 | |
| 函数和过程 | 现存 | |||
pg_propgraph_element |
19 | 14 | — | |
| 属性图元素(顶点和边) | 于 20 移除 | |||
pg_propgraph_element_label |
19 | 3 | — | |
| 属性图中元素与标签之间的链接 | 于 20 移除 | |||
pg_propgraph_label |
19 | 3 | — | |
| 属性图标签 | 于 20 移除 | |||
pg_propgraph_label_property |
19 | 4 | — | |
| 属性图中按标签区分的属性定义 | 于 20 移除 | |||
pg_propgraph_property |
19 | 6 | — | |
| 属性图属性 | 于 20 移除 | |||
pg_publication |
10 | 11 | 195 次 | |
| 用于逻辑复制的发布 | 现存 | |||
pg_publication_namespace |
15 | 3 | — | |
| 模式到发布映射 | 现存 | |||
pg_publication_rel |
10 | 6 | 193 次 | |
| 关系与发布的映射 | 现存 | |||
pg_range |
9.2 | 12 | 192 次 | |
| 范围类型的信息 | 现存 | |||
pg_replication_origin |
9.5 | 2 | — | |
| 已注册的复制源 | 现存 | |||
pg_rewrite |
9.0基线 | 8 | 123 次 | |
| 查询重写规则 | 现存 | |||
pg_seclabel |
9.1 | 5 | 9.51 次 | |
| 数据库对象上的安全标签 | 现存 | |||
pg_sequence |
10 | 8 | — | |
| 有关序列的信息 | 现存 | |||
pg_shdepend |
9.0基线 | 7 | — | |
| 共享对象上的依赖 | 现存 | |||
pg_shdescription |
9.0基线 | 3 | 9.51 次 | |
| 共享对象上的注释 | 现存 | |||
pg_shseclabel |
9.2 | 4 | 9.51 次 | |
| 共享数据库对象上的安全标签 | 现存 | |||
pg_statistic |
9.0基线 | 31 | 122 次 | |
| 规划器统计 | 现存 | |||
pg_statistic_ext |
10 | 9 | 174 次 | |
| 扩展的规划器统计信息(定义) | 现存 | |||
pg_statistic_ext_data |
12 | 6 | 152 次 | |
| 扩展的规划器统计信息(已构建的统计信息) | 现存 | |||
pg_subscription |
10 | 23 | 197 次 | |
| 逻辑复制订阅 | 现存 | |||
pg_subscription_rel |
10 | 4 | 131 次 | |
| 订阅的关系状态 | 现存 | |||
pg_tablespace |
9.0基线 | 5 | 122 次 | |
| 本数据库集簇内的表空间 | 现存 | |||
pg_transform |
9.5 | 5 | 121 次 | |
| 转换(将数据类型转换为过程语言需要的形式) | 现存 | |||
pg_trigger |
9.0基线 | 19 | 135 次 | |
| 触发器 | 现存 | |||
pg_ts_config |
9.0基线 | 5 | 121 次 | |
| 文本搜索配置 | 现存 | |||
pg_ts_config_map |
9.0基线 | 4 | — | |
| 文本搜索配置的词元映射 | 现存 | |||
pg_ts_dict |
9.0基线 | 6 | 121 次 | |
| 文本搜索字典 | 现存 | |||
pg_ts_parser |
9.0基线 | 8 | 121 次 | |
| 文本搜索分析器 | 现存 | |||
pg_ts_template |
9.0基线 | 5 | 121 次 | |
| 文本搜索模板 | 现存 | |||
pg_type |
9.0基线 | 32 | 144 次 | |
| 数据类型 | 现存 | |||
pg_user_mapping |
9.0基线 | 4 | 121 次 | |
| 将用户映射到外部服务器 | 现存 | |||