Re: [GENERAL] How to salvage a corrupted DB? - Mailing list pgsql-general

From Michael Simms
Subject Re: [GENERAL] How to salvage a corrupted DB?
Date
Msg-id 199909241856.TAA04505@argh.demon.co.uk
Whole thread Raw
In response to How to salvage a corrupted DB?  (Mark Dalphin <mdalphin@amgen.com>)
List pgsql-general
> Hi,
>
> I have an important database which I have been unable to backup/dump for "a long
> while". I am looking for a method to "fix" the problem.  As a last resort, I
> guess I could dump the DB table by table using "\copy", although I haven't tried
> yet. And I worry that the corrupted system tables may be accessed during a
> "\copy" so I may still be stuck.

<snip>

> Okay, what tables are present?
>
> > htg=> \d
> > pqReadData() -- backend closed the channel unexpectedly.
> >         This probably means the backend terminated abnormally
> >         before or while processing the request.
> > htg=>
> >
> Well, not quite such a hard crash; I'm still in psql, however, I am not
> connected to any DB an longer.

At the worst, you could, as you say, dump out the tables using copy.
To get the table list, look in the data directory, and you should see
all you need to know what tables are there

                        ~Michael

pgsql-general by date:

Previous
From: Mark Dalphin
Date:
Subject: How to salvage a corrupted DB?
Next
From: "Richard Ryan"
Date:
Subject: Any books available commercially?