We have a postgresql database that is maintained at night from a cron job with the following command:
su postgres -c "pg_dump our_database | gzip > /home/smb/shared/database_backup.bak.gz"
we recently had a disk crash that started with several bad sectors, and during that time pg_dump exited with the following errors
pg_dump: SQL command failed pg_dump: Error message from server: ERROR: catalog is missing 17 attribute(s) from relid 20158 pd_dump: The command was: LOCK TABLE public.obvez IN ACCESS SHARE MODE
Now, since it was in the cron job, no one noticed error messages, the backup was interrupted, but it was not zero, everything seemed fine, and the error went unnoticed until the final drive failed when we realized that we did not have a backup ,
We were able to recover data from an older backup, but now I would like to know what would be the right way to check if pg_dump completed its work with success or not?
source share