CREATE PUBLICATION

You can use the CREATE PUBLICATION statement to add a new publication to the current cluster.

Table of contents

Synopsis

CREATE PUBLICATION name
{ FOR TABLE table_name [, ...] | FOR ALL TABLES }

Description

Add a new publication to the current cluster. The publication name must be distinct from the name of any existing publication in the current cluster. A publication represents a group of tables whose data changes can be replicated by other clusters (subscribers) by creating a subscription.

If neither FOR TABLE nor FOR ALL TABLES is specified, then the publication starts out with an empty set of tables. That is useful if tables are to be added later. The creation of a publication does not start any replication.

Parameters

name

The name of the new publication.

FOR TABLE

Specifies a list of tables to add to the publication. The partitions of a partitioned table are always implicitly considered part of the publication.

FOR ALL TABLES

Marks the publication as one that replicates changes for all tables in the cluster, including tables created in the future.