0

Recently one of the machines running Postgres ran out of disk space. After deleting some trashes (not related in any way to postgres!) I've rebooted the system, and - after that - Postgres refuses to start. The log below:

LOG:  database system was not properly shut down; automatic recovery in progress
LOG:  record with zero length at 4/E7000288
LOG:  redo is not required
FATAL:  could not access status of transaction 2718420992
DETAIL:  Could not open file "pg_clog/0A20": No such file or directory.
LOG:  startup process (PID 11496) exited with exit code 1

I've googled a bit and all I've found is to create a zero-filled 256k file pg_clog/0A20. Unfortunately, this doesn't solve the problem as now it complains on following:

2013-09-18 10:29:58 CEST FATAL:  could not access status of transaction 2718420992
2013-09-18 10:29:58 CEST DETAIL:  Could not open file "pg_clog/0A20": No such file or directory.

The most important thing for me is to get it running again as soon as possible, I do not care about losing the unfinished transactions however I can't afford losing the archive data (i.e. the data collected before the system ran out of disk space).

migajek
  • 171
  • 2
  • 10
  • The second log message is not the real message, is just some detail. Could you show the messages above that one? – MatheusOl Sep 14 '13 at 16:36
  • @MatheusOl thats because the rest of log messages are the same as previously - anyway I've updated the answer – migajek Sep 18 '13 at 08:32

1 Answers1

0

pg_resetxlog is made for situations like this. Please read its man page, it contains important details.

Peter Eisentraut
  • 3,665
  • 1
  • 24
  • 21
  • I've tried running it with -f option, it said "Transaction log reset" but the startup error is still the same – migajek Sep 18 '13 at 08:33