Re: contents of pg_database vanished.. - Mailing list pgsql-general

From Tom Lane
Subject Re: contents of pg_database vanished..
Date
Msg-id 4573.1086623317@sss.pgh.pa.us
Whole thread Raw
In response to contents of pg_database vanished..  (Kari Lavikka <tuner@bdb.fi>)
List pgsql-general
Kari Lavikka <tuner@bdb.fi> writes:
> I noticed the problem while trying to use pg_dump:
>    tuner@xyzzy:~$ /usr/local/pgsql/bin/pg_dump -Ugalleria galleria
>    pg_dump: missing pg_database entry for database "galleria"

Hm.  The row must still be there, else you could not have got that far.
If you do "select * from pg_database", do you see all the rows you
expect?  How about "select * from pg_database where datname = 'galleria'"?

If you see the row with an unqualified select but not with "where
datname =", then I'd bet on the index for pg_database.datname being
corrupted.  You should be able to fix this with REINDEX.  Since
pg_database is a shared catalog, that will mean shutting down the
postmaster --- read the details in the REINDEX man page.

            regards, tom lane

pgsql-general by date:

Previous
From: "Campano, Troy"
Date:
Subject: Re: Backup and Restore of PostgreSQL
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] CREATE DATABASE on the heap with PostgreSQL?