Had a problem with pg_clog - Mailing list pgsql-general

From Peter Wiersig
Subject Had a problem with pg_clog
Date
Msg-id 20050421183906.GA5712@london087.server4you.de
Whole thread Raw
Responses Re: Had a problem with pg_clog
List pgsql-general
Hi List,

I had a database with a 8 Mb pg_dump file with 1.7 Gb in PG_DATA.

I dropped the database and tried to recreate the db with this
step:

psql template1 < data.sql

All tables and all data was restored and to help accessing the db
I tried to vacuum analyze it, yielding this error message:

    vacuumdb -z miwabar
    PANIC:  open of /var/lib/pgsql/data/pg_clog/0000 failed:
           Keine Berechtigung
    server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
    connection to server was lost
    vacuumdb: vacuum  miwabar failed

The panic message with -v gave
  PANIC:  read of clog file 0, offset 16384 failed: Erfolg

which lead me to the mailing-list archive and the following fix:

    dd bs=32k count=1 </dev/zero >/var/lib/pgsql/data/pg_clog/0000
    1+0 records in
    1+0 records out

afterwards my vacuum works.

Had I done the right thing?

Should I have expected this error?

--
Peter

pgsql-general by date:

Previous
From: "David Parker"
Date:
Subject: debug levels in server
Next
From: Kris Jurka
Date:
Subject: Re: lots of puzzling log messages