Logical replication replicates data changes at the level of specific tables (using a publish/subscribe model), rather than copying the entire database cluster byte-for-byte like physical (streaming) replication. This makes it flexible — selective, cross-version, and to different schemas — ideal for migrations and integrations.
Logical vs physical replication
PHYSICAL (streaming) → replicates the ENTIRE cluster at the storage/WAL level
✓ exact copy, simple ✗ all-or-nothing, same Postgres version, read-only replica
LOGICAL → replicates specific TABLES' changes via a publish/subscribe model
✓ SELECTIVE (choose tables), CROSS-VERSION, to DIFFERENT schemas, replica is WRITABLE
✗ more setup, some limitations (DDL not replicated automatically, etc.)
