Re: Recovery damaged dump file

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: mac pack <mac(dot)apxz(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Recovery damaged dump file
Date: 2017-03-10 01:35:14
Message-ID: CAB7nPqQ-ht14DbTFaSYWOzj0=xrs_rqo3sdkvN5L3tRm+qQ1Kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 9, 2017 at 8:55 PM, mac pack <mac(dot)apxz(at)gmail(dot)com> wrote:
> pg_restore db.backup > out.sql
>
> pg_restore: [custom archiver] unrecognized data block type (0) while
> searching archive
>
> The follow commands works fine:
> pg_restore -s db.backup > out.sql
> pg_restore -l db.backup

If you are lucky and as -l is able to print out the complete list of
objects and is able to dump all the schema, perhaps not everything is
lost. You may want to restore a limited set of objects by using
--use-list first, and see what can be saved.

> Do you think it's possible to recover the dump file, is there any method or
> tool to recover dump files?

Lost data would be lost. Likely you can still recover portions of it,
perhaps most of it.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nathan Valentine 2017-03-10 02:12:42 Re: Removing and readding bdr nodes
Previous Message Adrian Klaver 2017-03-09 21:37:28 Re: Unable to start postgresql