Alban Hertroys <haramrae@gmail.com> writes:
> On 26 May 2014, at 10:28, Khangelani Gama <kgama@argility.com> wrote:
>> It's psql 8.0.4, OS is Red Hat Linux release 9 (Shrike
> 8.0.4? That went EOL almost 4 years ago and even then you should be running a version around 8.0.26. You�re 22 bugfix
releasesbehind, which likely includes fixes for several data-corruption issues.
> See: http://www.postgresql.org/support/versioning/
8.0.x did not have any real defenses against transaction ID wraparound
(the behavior of forcing a shutdown when wraparound gets too close was
added in 8.1, and there was no built-in autovacuum back then either).
So my money is on this being a wraparound problem, ie, some dead but
never-vacuumed pg_database row has returned to visibility because its
deleting transaction is now "in the future".
If you're very lucky, vacuuming pg_database will fix it. But take a
backup *first*, in case you're not lucky and vacuuming makes things worse.
I'd shut down the postmaster and then make a physical copy (tarball) of
the whole data directory tree, just to be sure you can get back to where
you are.
As a former Red Hatter, I cannot resist making the point that your OS
version is even hoarier than your PG version, and is certainly full of
since-fixed bugs. You are *years* overdue for some serious attention to
software updates.
regards, tom lane