Re: database corruption help

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John Lister" <john(dot)lister-ps(at)kickstone(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: database corruption help
Date: 2009-02-09 17:31:33
Message-ID: 17205.1234200693@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

"John Lister" <john(dot)lister-ps(at)kickstone(dot)com> writes:
> ERROR: could not create unique index "pg_class_oid_index"

> a quick inspection of the pg_class table doesn't show any duplicates, is there anyway i can find out which row(s) are duplicated and remove them without a full db restore?

> also doing something like this doesn't return anything which worked for my other tables

> select oid from pg_class where oid in(select oid from pg_class group by oid having count(oid)>1 )

Try doing it with enable_indexscan = off and enable_bitmapscan = off.
The system might be relying on the old, bogus index to do the group by
oid.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Stefano Nichele 2009-02-09 17:43:43 strange autovacuum behaviour
Previous Message John Lister 2009-02-09 16:37:11 database corruption help

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-02-09 17:31:45 Re: new GUC var: autovacuum_process_all_tables
Previous Message Tom Lane 2009-02-09 17:27:05 Re: How to get SE-PostgreSQL acceptable