pg_publication_namespace

A system table containing the relationship between schemas and publications
This entry relates to a PostgreSQL feature which is part of PostgreSQL 15, due to be released in late 2022.

pg_publication_namespace is a system catalog table containing the mapping between schemas and publications.

pg_publication_namespace was added in PostgreSQL 15.

Definition by PostgreSQL version

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)
    

Documentation: pg_publication_namespace

Change history

Examples

If creating a publication for a schema, an entry associating the schema with the publication will be created in 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)

Categories

Logical replication, System catalogue

See also

pg_publication, pg_publication_rel