Recovering database after disk crash - Mailing list pgsql-general

From Vic Simkus
Subject Recovering database after disk crash
Date
Msg-id ce469da10805121338q71ed6b16sfb1864bbcf03db5f@mail.gmail.com
Whole thread Raw
Responses Re: Recovering database after disk crash
Re: Recovering database after disk crash
List 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@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@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

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: rounding problems
Next
From: Craig Ringer
Date:
Subject: Re: changing the endianness of a database