db crash after power crash

From: "Anton Maksimenkov" <anton200(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: db crash after power crash
Date: 2006-05-28 17:19:33
Message-ID: 8cac8dd0605281019n1b46ffefmd5ef80f999d237a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.

Some hours ago there was a power failure with my test machine while
active inserting data. After power back the OS done some "fsck", clean
some files (related to postgres working directory). Then I connect to
my DB and see this:

billing=# \d
ERROR: index "pg_attribute_relid_attnum_index" is not a btree
billing=# reindex index pg_attribute_relid_attnum_index;
ERROR: catalog is missing 1 attribute(s) for relid 2678

I searched through archives and tried to do some:

# reindexdb -s -U root -d billing
Password:
reindexdb: reindexing of system catalogs failed: ERROR: index
"pg_attribute_relid_attnum_index" is not a btree
# reindexdb -U root -d billing
Password:
reindexdb: reindexing of database "billing" failed: ERROR: index
"pg_attribute_relid_attnum_index" is not a btree

as you can see, without success. And so with vacuumdb.

That all was on my test (learning) environment... But this may occur
on production machine (who knows, anything may happens) and I want to
know how to play with such situations (or workaround them). My only
idea - to get the last 'pg_dump' file, drop database and restore it
from that file... but it is ugly idea because many recent data will be
lost. Is there other ways?

--
engineer

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-05-28 17:33:15 Re: db crash after power crash
Previous Message Ian Harding 2006-05-28 14:52:50 Re: Best open source tool for database design / ERDs?