RefLib

Reference library for AI

Back

postgresql_16:7.1.82.4 Examples

PostgreSQL 16 > Reference > SQL Commands > CREATE SUBSCRIPTION > Examples

Create a subscription to a remote server that replicates tables in the publications mypublication and insert_only and starts replicating immediately on commit: CREATE SUBSCRIPTION mysub CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb' PUBLICATION mypublication, insert_only;

Create a subscription to a remote server that replicates tables in the insert_only publication and does not start replicating until enabled at a later time. CREATE SUBSCRIPTION mysub CONNECTION 'host=192.168.1.50 port=5432 user=foo dbname=foodb' PUBLICATION insert_only WITH (enabled = false);

Back