Logisk replikation replikerer dataændringer på niveauet for bestemte tabeller (ved hjælp af en publish/subscribe-model), i stedet for at kopiere hele databaseklyngen byte-for-byte som ved fysisk (streaming) replikation. Dette gør den fleksibel — selektiv, versionsuafhængig og til forskellige skemaer — ideel til migrering og integrationer.
Logisk kontra fysisk 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.)
