CREATE SUBSCRIPTION
Function
CREATE SUBSCRIPTION 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
- This statement is supported by version 8.2.0.100 or later clusters.
- A subscription can be created only by the system administrator.
Syntax
1 2 3 4 |
CREATE SUBSCRIPTION name CONNECTION 'conninfo' PUBLICATION publication_name [, ...] [ WITH ( subscription_parameter [= value] [, ... ] ) ] |
Parameter Description
Parameter |
Description |
Value Range |
---|---|---|
name |
Specifies the name of a subscription. |
Value range: a string. It must comply with the naming convention. For details, see Identifier Naming Conventions. |
conninfo |
Specifies the string for connecting to the publication side. Example: host=1.1.1.1,2.2.2.2 port=10000,20000 dbname=postgres user=repusr1 password=password_123 |
|
publication_name |
Specifies the name of the publication you want to subscribe to on the publication side. A subscription corresponds to multiple publications. |
- |
WITH |
Specifies the optional parameters for a subscription. The right column lists the supported parameters. |
|
Examples
CREATE SUBSCRIPTION mysub CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb password=xxxx' PUBLICATION mypublication;
Helpful Links
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot