I am in the process of migrating our AWS RDS postgresql from one account to another with zero downtime. I am going with pg_dump/pg_restore + AWS CDC for ongoing replication.

I am looking for a way to generate and compare checksum to make sure no differences in data or corruption.

Q1: Is it possible to generate checksum on the database level rather than table level?

Q2: OR doing a select count(*) on all the tables in source/target is better?

when there is no downtime, data changes will be coming in the source during this process and i am afraid this will affect the checksum or rowcount comparison. Please advise

2 Answers 2


you can't achieve zero downtime migration with pg_dump. writes that happen after the dump begins and before the restore completes and you cut-over to the new database will be lost.

What you want is log shipping, use that to build a read-only replica of thew RDS server and then cut over to that once the replica is stable.

  • Hi Jasen, to avoid loss of data, I am going to use CDC recovery checkpoint to replay the messages to target. Is this different than you mentioned "log shipping". can you share some documentations for this
    – Falcon
    Sep 19, 2022 at 0:35

If your tables have PKs (which is a requirement for CDC), then you can enable DMS validation on your CDC-only task. Here are some [AWS DMS docs][1] on their validation. [1]: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Validating.html

  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Sep 11, 2023 at 19:52

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.