Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 69DCF632DF9 for ; Mon, 9 Feb 2009 13:32:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05593-05 for ; Mon, 9 Feb 2009 13:31:48 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2F198632DAD for ; Mon, 9 Feb 2009 13:31:45 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n19HVXR1017206; Mon, 9 Feb 2009 12:31:33 -0500 (EST) To: "John Lister" cc: pgsql-admin@postgresql.org Subject: Re: database corruption help In-reply-to: <507152DDF8AB4DF093BD01A8BEC7C659@squarepi.com> References: <507152DDF8AB4DF093BD01A8BEC7C659@squarepi.com> Comments: In-reply-to "John Lister" message dated "Mon, 09 Feb 2009 16:37:11 +0000" Date: Mon, 09 Feb 2009 12:31:33 -0500 Message-ID: <17205.1234200693@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/60 X-Sequence-Number: 31281 "John Lister" 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