LogBook


2025/07/16 [Learn Postgres]

I finished the logical replication chapter and started the last chapter of the book – useful extensions.
Postgres provide replication monitoring utilities – it’s the same table that monitors physical replication – pg_stat_replication table. You can also get more information about publishing and subscribing processes by querying pg_publication and pg_subscribtion tables on primary and replica nodes respectively.
Logical replication doesn’t block writes on replica node. However it seems to be bad practice to write to replica since in case of collisions on unique fields the pub/sub system will fail and stop streaming new messages to subscribers until DBA resolves the issue.
Synchronization errors are then fixed by dropping subscription, truncating tables with discrepancies and re-creating the subscription.
Moreover logical replication doesn’t support DDL changes so DBA is responsible for keeping databases schemas in sync. Otherwise pub/sub will again fail and require manual fix.