https://www.postgresql.org/docs/10/logical-replication-restrictions.html States: "When the schema is changed on the publisher and replicated data starts arriving at the subscriber but does not fit into the table schema, replication will error until the schema is updated"

How do we detect/query for these errors on Postgres?

I tried

SELECT * FROM pg_stat_subscription;

but it shows that it received the publisher's message. It errored out when I changed publisher's schema and subcriber stopped getting updates.

on AWS, the RDS cloudwatch metrics related to it is:

OldestReplicationSlotLag (The lagging size of the replica lagging the most in terms of WAL data received. Applies to PostgreSQL)

but I don't think this is the right metric if I want to know if my updates have corrected applied to the subscriber replica database.

1 Answer 1


Through trial and error I found out that you can use OldestReplicationSlotLag.

If there are replication errors, it accumlates the slotlag bytes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.