How do I repair a corrupted system table in PostgreSQL? - Mailing list pgsql-general

From David Hamilton
Subject How do I repair a corrupted system table in PostgreSQL?
Date
Msg-id BANLkTi=2LX3d01uK+DSMByhTsTRg5x_Fmw@mail.gmail.com
Whole thread Raw
List pgsql-general

I just attempted to do a pg_upgrade on a fairly large PostgreSQL database cluster from version 8.3.0 to version 9.0.4. Everything looked like it was going to work just fine until the new schema was being created on the target cluster. It died trying to create a group role twice for some reason.

After looking at all the scripts, it was quite obvious that it was duplicating a group role 4 times. I brought the 8.3.0 database back up and it was very apparent that there was a row repeated in the pg_authidtable.

I tried bringing the database up in single-user mode in order to try to REINDEX TABLE pg_authid. This failed when trying to create the new index with duplicated values. I tried deleting the offending group role. This removed one of the 4 rows in pg_authid, but just seemed to confuse things further.

I saw mention that running a full vacuum on the table may repair such corruption, but I have little hope of that working. So, while the data restores, I'll fish for ideas.

pgsql-general by date:

Previous
From: Geoffrey Myers
Date:
Subject: proper regex_replace() syntax
Next
From: Ken Tanzer
Date:
Subject: Re: proper regex_replace() syntax