Re: Database recovery after fs crash

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: J(dot)Henning(at)t-online(dot)de
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Database recovery after fs crash
Date: 2003-08-26 00:17:48
Message-ID: 20030826001748.GA31732@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wow. Take to pull out those backups...

Hmm, presumably you don't have those. There are programs to read postgresql
data files however they need to know the exact structure of the table before
you can even start to decode them. I usually start by browsing files by hand
to see if I can determine from any embedded text which table it was.

Then if you create a new database and recreate the table *exactly* the same
and then copy the datafile over. You might need to create some clog files
but you *might* be able to recover some data.

It's a bit tricky though. Black magic and all that. Backups are absolutly
the best way.

Hope this helps,
On Mon, Aug 25, 2003 at 11:12:20PM +0200, J(dot)Henning(at)t-online(dot)de wrote:
> Hi,
>
> I've got a serious problem. After a horrible filesystem crash the only thing
> left of my database are some files in /lost+found (with changed names!). Is
> there a way to recover the data from those files? I managed to identify the
> files belonging to PostgreSQL (unfortunately, these are part of more than one
> database (think of template0/1...)), but I don't know which file belongs to
> which table.
> I've searched the web for recovery tools but none of them seems capable of
> what I want to do. Is there any documentation on the structure of
> PostgreSQL's
> database files?
> If this is the wrong place to ask, please tell me where I might get help.
>
> Cheers,
> Christian
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory S. Williamson 2003-08-26 01:03:30 is linux ready for databases ? (Ziff Davis article on Oracle and Linux)
Previous Message Tom Lane 2003-08-25 23:36:10 Re: timeofday() and CAST