We have setup database postgresql 11 on a system. There are about 8 tables. From few days, we are facing this problem
ERROR: invalid page in block 9698 of relation base/16385/16560 SQL state: XX001
According to my research, we should set set zero_damaged_pages=on; to fix this issue. We have set and executed few select queries that works fine. Then we decided to take backup of this database via pg_dump. This job was not completed successfully but copied all records.
Now, on new system, we imported backup, we have come to know that database schema is not properly copied here due to which data duplication occured. We repeated this with another database that was fine. All things works fine including restore.
Finally, I conclude that due to error in a block of page, database was not properly backed up. Is there any such option like set zero_damaged_pages=on; in pg_dump to ignore error page but complete the back or any other solution.