Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a Postgres database that crashed (as well as the disk) and suffered some data errors (per

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
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.


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

Your Answer


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.