CREATE SUBSCRIPTION

Function

Adds a new subscription to the current database. The subscription name must be different from a name of any existing subscription in the database. A subscription represents a replication for connecting to the publication side.

Precautions

Syntax

1
2
3
4
CREATE SUBSCRIPTION name
    CONNECTION 'conninfo'
    PUBLICATION publication_name [, ...]
    [ WITH ( subscription_parameter [= value] [, ... ] ) ]

Parameter Description

Examples

Create a subscription to tables of the publication mypublication on a remote server.
CREATE SUBSCRIPTION mysub
    CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb password=xxxx'
    PUBLICATION mypublication;

Helpful Links

ALTER SUBSCRIPTION DROP SUBSCRIPTION