Обсуждение: contents of pg_database vanished..

Поиск
Список
Период
Сортировка

contents of pg_database vanished..

От
Kari Lavikka
Дата:
Hi,

I'm having some problems with pg_database -system table. It lost all of
it's contents while database was running. It's actually still running but
I don't know what to do because I'm not sure if it will start up at all
after shutdown.

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"

I could probably insert the missing row to pg_database but there are some
columns I'm not sure about. What are datlastsysoid, datvacuumxid and
datfrozenxid?

Btw, pg version is 7.4.1

Thanks..

    |\__/|
    ( oo )    Kari Lavikka - tuner@bdb.fi - (050) 380 3808
__ooO(  )Ooo_______ _____ ___ _ _  _   _    _      _                  _
      ""

Re: contents of pg_database vanished..

От
Tom Lane
Дата:
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