Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a Postgres database that crashed (as well as the disk) and suffered some data errors (per http://serverfault.com/questions/156152/after-db-disk-failure-now-cache-lookup-failed-for-index).

The initial problem seems to be the system tables, as the answer in that question suggests. However it's been impossible to even try to reindex the database.

Trying postgres -P -D datadir dbname yields the same error, FATAL: cache lookup failed for index 2662 - isn't that what the -P flag is supposed to get around?

How do you connect to the database to reindex the database if you can't ignore the system tables? Or is something else going on?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

In this case, where the -P flag still results in errors, the database is almost certainly beyond (reasonable) recovery.

This:

postgres -O -P -D /data/dir -c log_error_verbosity=verbose dbname

yields additional information. In this instance it meant corruption beyond the pg_class table.

More info on the pgsql-admin list.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.