pg_publication_namespace
是一个包含模式和发布之间映射的系统目录表。
pg_publication_namespace
添加于PostgreSQL 15。
按 PostgreSQL 版本定义
pg_publication_namespace (PostgreSQL 17)
Table "pg_catalog.pg_publication_namespace" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- oid | oid | | not null | pnpubid | oid | | not null | pnnspid | oid | | not null | Indexes: "pg_publication_namespace_oid_index" PRIMARY KEY, btree (oid) "pg_publication_namespace_pnnspid_pnpubid_index" UNIQUE CONSTRAINT, btree (pnnspid, pnpubid)
pg_publication_namespace (PostgreSQL 16)
Table "pg_catalog.pg_publication_namespace" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- oid | oid | | not null | pnpubid | oid | | not null | pnnspid | oid | | not null | Indexes: "pg_publication_namespace_oid_index" PRIMARY KEY, btree (oid) "pg_publication_namespace_pnnspid_pnpubid_index" UNIQUE CONSTRAINT, btree (pnnspid, pnpubid)
pg_publication_namespace (PostgreSQL 15)
Table "pg_catalog.pg_publication_namespace" Column | Type | Collation | Nullable | Default ---------+------+-----------+----------+--------- oid | oid | | not null | pnpubid | oid | | not null | pnnspid | oid | | not null | Indexes: "pg_publication_namespace_oid_index" PRIMARY KEY, btree (oid) "pg_publication_namespace_pnnspid_pnpubid_index" UNIQUE CONSTRAINT, btree (pnnspid, pnpubid)
更改历史记录
- PostgreSQL 15
- 添加 (提交 5a283246)
示例
如果为模式创建发布,则将在pg_publication_namespace
中创建将该模式与发布关联的条目。
postgres=# CREATE PUBLICATION foopub FOR ALL TABLES IN SCHEMA foo; CREATE PUBLICATION postgres=# SELECT * FROM pg_publication_namespace ; oid | pnpubid | pnnspid -------+---------+--------- 16430 | 16429 | 16414 (1 row)
参考文献
- PostgreSQL 文档: pg_publication_namespace