pg_publication_tables

列出发布物与其表之间映射关系的系统视图

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

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

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

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

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

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

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

pg_publication_tables (PostgreSQL 10)

      View "pg_catalog.pg_publication_tables"
   Column   | Type | Collation | Nullable | Default 
------------+------+-----------+----------+---------
 pubname    | name |           |          | 
 schemaname | name |           |          | 
 tablename  | name |           |          |
    

文档: pg_publication_tables

更改历史记录

PostgreSQL 10引入以来,此视图一直保持不变。

示例

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)

分类

逻辑复制复制系统目录

另请参阅

pg_publication_relpg_publication

反馈

请在此处提交关于 "pg_publication_tables" 的任何评论、建议或更正 此处