Postgres not accepting commands and Vacuum failed

625 Views Asked by At

First of all, yes, its an old version of Postgres (8.4), but upgrading is not an option at present.

On a large production database with many tables and rows, the database went down with the following error:

dbname user 2017-09-13 13:30:01.570 UTC  ERROR:  database is not accepting commands to avoid wraparound data loss in database "dbname"
dbname user 2017-09-13 13:30:01.570 UTC  HINT:  Stop the postmaster and use a standalone backend to vacuum database "dbname".
        You might also need to commit or roll back old prepared transactions.

We attempted to Vacuum the database (in single user mode), however this was not very successful (ran for 12 hours before failing):

backend> vacuum;
  2017-09-15 05:40:10.439 UTC  ERROR:  could not open relation with OID 1453898
  2017-09-15 05:40:10.439 UTC  STATEMENT:  vacuum;
backend>

After a restart the database was still not accepting commands. We tried a reindex, but that failed due to the original issue.

I attempted to locate OID 1453898 using:

SELECT 1453898::regclass;

But no results returned.

What else can be done to clean up and resolve this issue?

0

There are 0 best solutions below