Summary
The catalog pg_publication_rel contains the mapping between relations and publications in the database. This is a many-to-many mapping. See also pg_publication_tables for a more user-friendly view of this information.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_publication_rel system catalog exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
oidoid
Row identifierprpubidoidreferencespg_publication.oid
Reference to publicationprrelidoidreferencespg_class.oid
Reference to tableprexceptbool
True if the table is excluded from the publication. See EXCEPT.prqualpg_node_tree
Expression tree (in nodeToString() representation) for the relation’s publication qualifying condition. Null if there is no publication qualifying condition.prattrsint2vectorreferencespg_attribute.attnum
This is an array of values that indicates which table columns are part of the publication. For example, a value of 1 3 would mean that the first and the third table columns are published. A null value indicates that all columns are published.
Related catalogs
This object references the following other system catalogs:
prpubid→pg_publicationprrelid→pg_classprattrs→pg_attribute
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_publication_rel.