pg_replication_origin
是一个存储所有创建的复制源的系统目录表。
pg_replication_origin
在PostgreSQL 9.5中添加。
此表在集群中的所有数据库之间共享。
系统目录视图pg_replication_origin_status
提供了更用户友好的替代方案,并包含有关复制进度的其他数据。
按 PostgreSQL 版本定义
pg_replication_origin (PostgreSQL 17)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" PRIMARY KEY, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE CONSTRAINT, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 16)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" PRIMARY KEY, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE CONSTRAINT, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 15)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" PRIMARY KEY, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE CONSTRAINT, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 14)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" PRIMARY KEY, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE CONSTRAINT, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 13)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 12)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | C | not null | Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 11)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | | not null | Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname text_pattern_ops), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 10)
Table "pg_catalog.pg_replication_origin" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- roident | oid | | not null | roname | text | | not null | Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname text_pattern_ops), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 9.6)
Table "pg_catalog.pg_replication_origin" Column | Type | Modifiers ---------+------+----------- roident | oid | not null roname | text | not null Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname text_pattern_ops), tablespace "pg_global" Tablespace: "pg_global"
pg_replication_origin (PostgreSQL 9.5)
Table "pg_catalog.pg_replication_origin" Column | Type | Modifiers ---------+------+----------- roident | oid | not null roname | text | not null Indexes: "pg_replication_origin_roiident_index" UNIQUE, btree (roident), tablespace "pg_global" "pg_replication_origin_roname_index" UNIQUE, btree (roname text_pattern_ops), tablespace "pg_global" Tablespace: "pg_global"
变更历史
自它在PostgreSQL 9.5中添加以来,此表没有被修改过。
- PostgreSQL 9.5
- 添加 (提交 5aa23504)
示例
pg_replication_origin
的示例内容
postgres=# SELECT * FROM pg_replication_origin; roident | roname ---------+--------------------------------------- 1 | pgl_app_app_provider_app_subscription (1 row)
参考
- PostgreSQL 文档: pg_replication_origin