pg_publication_tables
是一个列出 发布物 及其包含的表之间映射关系的 系统目录 视图。
pg_publication_tables
添加于 PostgreSQL 10。
按 PostgreSQL 版本定义
pg_publication_tables (PostgreSQL 18)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+--------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | | attnames | name[] | | | rowfilter | text | | |
pg_publication_tables (PostgreSQL 17)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+--------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | | attnames | name[] | | | rowfilter | text | | |
pg_publication_tables (PostgreSQL 16)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+--------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | | attnames | name[] | | | rowfilter | text | | |
pg_publication_tables (PostgreSQL 15)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+--------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | | attnames | name[] | | | rowfilter | text | | |
pg_publication_tables (PostgreSQL 14)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | |
pg_publication_tables (PostgreSQL 13)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | |
pg_publication_tables (PostgreSQL 12)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | |
pg_publication_tables (PostgreSQL 11)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | |
pg_publication_tables (PostgreSQL 10)
View "pg_catalog.pg_publication_tables" Column | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- pubname | name | | | schemaname | name | | | tablename | name | | |
更改历史
自 PostgreSQL 10 引入以来,此视图保持不变。
- PostgreSQL 10
- 添加 (提交 665d1fad)
示例
pg_publication_tables
的示例用法
postgres=# \dt List of relations Schema | Name | Type | Owner --------+------+-------+---------- public | bar | table | postgres public | foo | table | postgres (2 rows) postgres=# CREATE PUBLICATION foo_publication FOR TABLE foo; CREATE PUBLICATION postgres=# CREATE PUBLICATION all_publication FOR ALL TABLES; CREATE PUBLICATION postgres=# SELECT * FROM pg_publication_tables; pubname | schemaname | tablename -----------------+------------+----------- foo_publication | public | foo all_publication | public | foo all_publication | public | bar (3 rows)
参考文献
- PostgreSQL 文档: pg_publication_tables