My PostgreSQL server was affect by a Ransomware virus. I'm trying to restore the database from a dump file made by pg_dump in custom format (-F c option), but the dump file seems to be damaged in the first's 1000 lines.
Opening the file with vi shows ^@^@^@^@^@^@^@^@^@^@^ followed by part of the databse schema and the a lote of lines with binary characters that i think is the table's data.
The custom format is a binary format so non text characters would be expected.
Did you try to restore using the file, before doing the below?
yes
If there was an error when you did that and if so what was it?
Should be:
Was there an error when you did that and if so what was it?
pg_restore db.bckup > out.sql pg_restore: [archiver] input file does not appear to be a valid archive
Opening the original damaged file in vi with :%!xxd it show's: