db crash after power crash

Поиск
Список
Период
Сортировка
От Anton Maksimenkov
Тема db crash after power crash
Дата
Msg-id 8cac8dd0605281019n1b46ffefmd5ef80f999d237a3@mail.gmail.com
обсуждение исходный текст
Ответы Re: db crash after power crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jorge Godoy"
Дата:
Сообщение: Re: postgres 7 and eastern language
Следующее
От: Tom Lane
Дата:
Сообщение: Re: db crash after power crash