CREATE_PUBLICATION man page on Kali

Man page or keyword search:  
man Server   9211 pages
apropos Keyword Search (all sections)
Output format
Kali logo
[printable version]

CREATE PUBLICATION(7)	 PostgreSQL 10.1 Documentation	 CREATE PUBLICATION(7)

NAME
       CREATE_PUBLICATION - define a new publication

SYNOPSIS
       CREATE PUBLICATION name
	   [ FOR TABLE [ ONLY ] table_name [ * ] [, ...]
	     | FOR ALL TABLES ]
	   [ WITH ( publication_parameter [= value] [, ... ] ) ]

DESCRIPTION
       CREATE PUBLICATION adds a new publication into the current database.
       The publication name must be distinct from the name of any existing
       publication in the current database.

       A publication is essentially a group of tables whose data changes are
       intended to be replicated through logical replication. See Section 31.1
       for details about how publications fit into the logical replication
       setup.

PARAMETERS
       name
	   The name of the new publication.

       FOR TABLE
	   Specifies a list of tables to add to the publication. If ONLY is
	   specified before the table name, only that table is added to the
	   publication. If ONLY is not specified, the table and all its
	   descendant tables (if any) are added. Optionally, * can be
	   specified after the table name to explicitly indicate that
	   descendant tables are included.

	   Only persistent base tables can be part of a publication. Temporary
	   tables, unlogged tables, foreign tables, materialized views,
	   regular views, and partitioned tables cannot be part of a
	   publication. To replicate a partitioned table, add the individual
	   partitions to the publication.

       FOR ALL TABLES
	   Marks the publication as one that replicates changes for all tables
	   in the database, including tables created in the future.

       WITH ( publication_parameter [= value] [, ... ] )
	   This clause specifies optional parameters for a publication. The
	   following parameters are supported:

	   publish (string)
	       This parameter determines which DML operations will be
	       published by the new publication to the subscribers. The value
	       is comma-separated list of operations. The allowed operations
	       are insert, update, and delete. The default is to publish all
	       actions, and so the default value for this option is 'insert,
	       update, delete'.

NOTES
       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 replication. It only
       defines a grouping and filtering logic for future subscribers.

       To create a publication, the invoking user must have the CREATE
       privilege for the current database. (Of course, superusers bypass this
       check.)

       To add a table to a publication, the invoking user must have ownership
       rights on the table. The FOR ALL TABLES clause requires the invoking
       user to be a superuser.

       The tables added to a publication that publishes UPDATE and/or DELETE
       operations must have REPLICA IDENTITY defined. Otherwise those
       operations will be disallowed on those tables.

       For an INSERT ... ON CONFLICT command, the publication will publish the
       operation that actually results from the command. So depending of the
       outcome, it may be published as either INSERT or UPDATE, or it may not
       be published at all.

       COPY ... FROM commands are published as INSERT operations.

       TRUNCATE and DDL operations are not published.

EXAMPLES
       Create a publication that publishes all changes in two tables:

	   CREATE PUBLICATION mypublication FOR TABLE users, departments;

       Create a publication that publishes all changes in all tables:

	   CREATE PUBLICATION alltables FOR ALL TABLES;

       Create a publication that only publishes INSERT operations in one
       table:

	   CREATE PUBLICATION insert_only FOR TABLE mydata
	       WITH (publish = 'insert');

COMPATIBILITY
       CREATE PUBLICATION is a PostgreSQL extension.

SEE ALSO
       ALTER PUBLICATION (ALTER_PUBLICATION(7)), DROP PUBLICATION
       (DROP_PUBLICATION(7))

PostgreSQL 10.1			     2017		 CREATE PUBLICATION(7)
[top]

List of man pages available for Kali

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net