pg_publication_tables
是一个列出发布物与其包含的表之间映射关系的系统目录视图。
pg_publication_tables
添加于PostgreSQL 10。
按 PostgreSQL 版本定义
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