How to salvage a corrupted DB?

From: Mark Dalphin <mdalphin(at)amgen(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to salvage a corrupted DB?
Date: 1999-09-24 18:11:32
Message-ID: 37EBBED4.D66A2026@amgen.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

The problem began when a "vacuum analyse" crashed. I can no longer run 'vacuum'
without an immediate crash:

> htg=> vacuum;
> pqReadData() -- backend closed the channel unexpectedly.
> This probably means the backend terminated abnormally
> before or while processing the request.
> We have lost the connection to the backend, so further processing is impossible. Terminating.
>
This returns me to the shell prompt.

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.

After reconnecting, I can still read and write user data from this DB, but all
attempts to access the system (pg_*) tables cause this type of message.

I am currently running Postgresql ver 6.5.1 (Patched for 'vacuum' problems and
patched for UNIQUE INDEXES) on an SGI IRIX 6.5 system. The initial "crash
during vacuuming" occured prior to when I applied the 'vacuum' patch.

If I open up a different DB than this one, I have no problem with accessing the
system tables: '\d' works, pg_dump works, etc.

Suggestions on how to recover the data would be most welcome.

Thanks,
Mark

--
Mark Dalphin email: mdalphin(at)amgen(dot)com
Mail Stop: 29-2-A phone: +1-805-447-4951 (work)
One Amgen Center Drive +1-805-375-0680 (home)
Thousand Oaks, CA 91320 fax: +1-805-499-9955 (work)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Simms 1999-09-24 18:56:46 Re: [GENERAL] How to salvage a corrupted DB?
Previous Message Adriaan Joubert 1999-09-24 15:27:36 Re: [HACKERS] Re: [GENERAL] Update of bitmask type