Re: Database recovery after fs crash - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Database recovery after fs crash
Date
Msg-id 20030826001748.GA31732@svana.org
Whole thread Raw
In response to Database recovery after fs crash  (J.Henning@t-online.de)
Responses Re: Database recovery after fs crash
Re: Database recovery after fs crash
List 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.Henning@t-online.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@svana.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

Attachment

pgsql-general by date:

Previous
From: Gianni Mariani
Date:
Subject: Re: convert database to unicode
Next
From: Tom Lane
Date:
Subject: Re: timeofday() and CAST