Veryfing pg_restore database with pg_dump database
-
24-01-2021 - |
質問
I just did a migration from Postgres 9.4 to 10 database. How to verify if everything is okay?
I tried to look into huge tables, the rows are different (somehow in Postgres 10 then are more rows than in 9.4)
PSQL 9.4: 14 583 936
PSQL 10: 14 880 545
here are my pg_dump and pg_restore commands which were executed without errors, but took very long process, dump was 12hours, while pg_restore 10hours:
pg_dump -U postgres -d hive -Z1 -Fc -f /mnt/offline_backups/hive_full_2019-03-01_1630.dmp 2> /mnt/offline_backups/hive_full_2019-03-01_1630.log
pg_restore -U postgres -d hive -v /mnt/offline_backups/hive_full_2019-03-01_1630.dmp
both commands were without errors whatsoever.
Here some screenshots from pgadmin 4v:
In both DB I just sorted rows count in descending order.
As you can see, rows inserted is quite different.
Here is summary:
解決
Thanks to A_horse_with_no_name for a suggestion, i did some of the tables select count(*) and returned identical rows for each table.
所属していません dba.stackexchange