Re: Postgres db corrupted ? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Postgres db corrupted ?
Date
Msg-id 21943.1059489530@sss.pgh.pa.us
Whole thread Raw
In response to Postgres db corrupted ?  ("John P. Looney" <valen@tuatha.org>)
Responses Re: Postgres db corrupted ?  ("John P. Looney" <valen@tuatha.org>)
List pgsql-admin
"John P. Looney" <valen@tuatha.org> writes:
>  What's up here ? Google is deathly silent.=20

> bash-2.05a$  pg_dumpall > db.out
> connected to template1...
> dumping database "MyPgSQLTest"...
> dumping database "bb1"...
> dumping database "bbadmin"...
> pg_dump: [archiver (db)] connection to database "bbadmin" failed: FATAL
> 1:  SetDatabaseEncoding(): invalid database encoding
> pg_dump failed on bbadmin, exiting

A quick-and-dirty nostrum that sometimes helps for this sort of thing
is "vacuum full pg_database".  (The idea is to get rid of dead tuples
that a new backend might be accidentally picking instead of the live
ones --- it has to read pg_database before it's joined the PROC array,
which among other things means it can't tell 100% accurately which rows
are really committed.)

If no go, could we see the output of "select * from pg_database"?

            regards, tom lane

pgsql-admin by date:

Previous
From: Dani Oderbolz
Date:
Subject: Re: Partition DB Tables by month
Next
From: Ragnar Kjørstad
Date:
Subject: Re: Replication/Failover/HA solution