📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials PostgreSQL Essentials Logical Replication

Logical Replication

7 min read
Logical replication copies specific tables to a subscriber across different PostgreSQL versions. This enables zero-downtime major version upgrades. DDL changes must be applied manually to the subscriber database.

Logical Replication

Unlike streaming replication, logical replication lets you replicate specific tables or filter rows.

-- On publisher
CREATE PUBLICATION my_pub FOR TABLE users, orders;

-- On subscriber
CREATE SUBSCRIPTION my_sub
  CONNECTION 'postgresql://host/dbname'
  PUBLICATION my_pub;