Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id ACA7763305D for ; Mon, 9 Feb 2009 15:25:44 -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 31908-05-3 for ; Mon, 9 Feb 2009 15:25:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kickstone.com (smtp.kickstone.com [87.194.183.70]) by mail.postgresql.org (Postfix) with ESMTP id CC4DE633060 for ; Mon, 9 Feb 2009 15:20:43 -0400 (AST) Received: from madras2.square-pi.com ([192.168.2.131] helo=MADRAS2) by mail.kickstone.com with esmtpa (Exim 4.69) (envelope-from ) id 1LWbgO-0002tX-AM; Mon, 09 Feb 2009 19:20:40 +0000 Message-ID: From: "John Lister" To: "Tom Lane" Cc: References: <507152DDF8AB4DF093BD01A8BEC7C659@squarepi.com> <17205.1234200693@sss.pgh.pa.us> Subject: Re: database corruption help Date: Mon, 9 Feb 2009 19:20:40 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200902/62 X-Sequence-Number: 31283 Cheers tom, that did it - i've removed the duplicates and seeing what else is broken. . > "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 >