database corruption help

From: "John Lister" <john(dot)lister-ps(at)kickstone(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: database corruption help
Date: 2009-02-09 16:37:11
Message-ID: 507152DDF8AB4DF093BD01A8BEC7C659@squarepi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Hi, my wal archiving broke and postgresql filled up the local disk with transaction logs, which i foolishly deleted in a moment of madness, after resetting the transaction log a few of my tables are damaged but repairable. However the system tables also seemed to have suffered. My main problem is duplicate rows which violated the primary key and if i do a reindex system i get similar errors, for example:

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 )

Many thanks
--

Got needs? Get Goblin'! - http://www.pricegoblin.co.uk/

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2009-02-09 17:31:33 Re: database corruption help
Previous Message Jeff Frost 2009-02-08 23:41:14 Re: Postgres will no longer startup

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-02-09 16:40:13 Re: add_path optimization
Previous Message Marko Kreen 2009-02-09 16:36:00 Re: WIP: fix SET WITHOUT OIDS, add SET WITH OIDS