Logische Replikation repliziert Datenänderungen auf der Ebene spezifischer Tabellen (mit einem Publish/Subscribe-Modell), anstatt das gesamte Datenbankcluster byte-für-byte wie bei physischer (Streaming-)Replikation zu kopieren. Dies macht sie flexibel — selektiv, versionsübergreifend und zu verschiedenen Schemas — ideal für Migrationen und Integrationen.
Logische vs. physische Replikation
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.)
