Recovering database after disk crash

From: "Vic Simkus" <vic(dot)simkus(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Recovering database after disk crash
Date: 2008-05-12 20:38:38
Message-ID: ce469da10805121338q71ed6b16sfb1864bbcf03db5f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

A disk hosting an instance of 8.2 crashed on me (hardware failure). I
was able to pull most of the data off the drive, but the one database
that I need the most is corrupt. I'm not really sure where to
start... so here are some error messages:

postgres(at)vsimkus-laptop:/var/log/postgresql$ pg_dump EPC
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: index
"pg_opclass_am_name_nsp_index" contains unexpected zero page at block
0
HINT: Please REINDEX it.
pg_dump: The command was: SELECT tableoid, oid, *, (SELECT rolname
FROM pg_catalog.pg_roles WHERE oid = '10') as lanowner FROM
pg_language WHERE lanispl ORDER BY oid

postgres(at)vsimkus-laptop:/var/log/postgresql$ reindexdb EPC
NOTICE: table "pg_class" was reindexed
reindexdb: reindexing of database "EPC" failed: ERROR: catalog is
missing 4 attribute(s) for relid 10762

Almost every operation I attempt ends in a similar error message:

EPC=# \dt
ERROR: index "pg_opclass_am_name_nsp_index" contains unexpected zero
page at block 0
HINT: Please REINDEX it.

EPC=# select * from siemr_sys.zip_codes;
ERROR: catalog is missing 10 attribute(s) for relid 1337158

EPC=# select * from siemr_sys.sex_list;
ERROR: catalog is missing 2 attribute(s) for relid 1337150

EPC=# select * from siemr_data.visits;
ERROR: catalog is missing 7 attribute(s) for relid 1337095

Is there some way I can extract the data from the tables even if the
metadata is corrupt?

Thanks
Vic

--
Men never do evil so completely and cheerfully as when they do it from
religious conviction.

-Blaise Pascal

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-05-12 20:42:44 Re: changing the endianness of a database
Previous Message Craig Ringer 2008-05-12 20:29:06 Re: rounding problems