4 ms·
I've used dumps as backups and never experienced this issue, although they would stop prematurely from time to time. The solution was just to check the string a
by forinti 4y ago
I've used dumps as backups and never experienced this issue, although they would stop prematurely from time to time. The solution was just to check the string at the end and repeat the dump if it wasn't there.
- 411111111111111 4y agoConsidering that -Fc is a binary format, how would i check a string at the end of it?
- forinti 4y agoIf you do an SQL dump, it will end with "-- PostgreSQL database dump complete". If you use -Fc, you can make an SQL file from the dump using pg_restore like this: pg_restore -f db.sql db.dmp Or straight to stdout like this: pg_restore -f - db.dmp | grep "database dump complete" Although I guess if it's corrupted pg_restore won't work. It is really fast, but might not be practical if your database is too big.
- 411111111111111 4y agoMy issue was indeed the mishmash of versions, as the restore succeeded with the mentioned steps (installing old version, restoring, upgrading). nonetheless, interesting way to validate a backup, though it would probably take too long on most dumps