Help Center/
GaussDB/
Developer Guide(Centralized_2.x)/
Logical Replication/
Publication-Subscription/
Quick Setup
Updated on 2023-10-23 GMT+08:00
Quick Setup
Set the following configuration items in the postgresql.conf file:
wal_level = logical
For a basic setup, retain the default values for the other necessary configuration items.
You need to adjust the pg_hba.conf file to allow replication (the value depends on the actual network configuration and the user used for connection).
host all repuser 0.0.0.0/0 sha256
In the publisher database:
CREATE PUBLICATION mypub FOR TABLE users, departments;
In the subscriber database:
CREATE SUBSCRIPTION mysub CONNECTION 'dbname=foo host=bar user=repuser' PUBLICATION mypub;
The above statements start the replication process, replicating incremental changes to those tables.
Parent topic: Publication-Subscription
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot