CREATE PUBLICATION

An SQL command for defining a new publication

CREATE PUBLICATION is a DDL command for defining a new publication.

CREATE PUBLICATION was added in PostgreSQL 10.

Change history

Examples

Basic usage example for CREATE PUBLICATION:

postgres=# CREATE PUBLICATION misc_publication
             FOR TABLE foo;
CREATE PUBLICATION

postgres=# \dRp
                                     List of publications
       Name       |  Owner   | All tables | Inserts | Updates | Deletes | Truncates | Via root 
------------------+----------+------------+---------+---------+---------+-----------+----------
 misc_publication | postgres | f          | t       | t       | t       | t         | f
(1 row)

Categories

DDL, Logical replication, SQL command

See also

ALTER PUBLICATION, DROP PUBLICATION, CREATE SUBSCRIPTION, pg_publication, pg_publication_rel