Received: from mailb.telia.com (root@mailb.telia.com [194.22.194.6]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA37146 for ; Tue, 25 Jan 2000 19:33:48 -0500 (EST) (envelope-from girgen@partitur.se) Received: from d1o90.telia.com (d1o90.telia.com [195.67.216.241]) by mailb.telia.com (8.9.3/8.9.3) with ESMTP id BAA00975; Wed, 26 Jan 2000 01:31:59 +0100 (CET) Received: from stordatan.telia.com (t1o90p62.telia.com [195.67.216.62]) by d1o90.telia.com (8.8.8/8.8.8) with ESMTP id BAA12380; Wed, 26 Jan 2000 01:31:58 +0100 (CET) Received: from partitur.se (localhost [127.0.0.1]) by stordatan.telia.com (8.9.3/8.9.1) with ESMTP id BAA21087; Wed, 26 Jan 2000 01:31:42 +0100 (CET) (envelope-from girgen@partitur.se) Sender: girgen@partitur.se Message-ID: <388E406E.D591309E@partitur.se> Date: Wed, 26 Jan 2000 01:31:42 +0100 From: Palle Girgensohn Organization: Partitur X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.0.36 i386) X-Accept-Language: sv, en MIME-Version: 1.0 To: Bruce Momjian CC: Tom Lane , Patrik Kudo , "pgsql-sql@postgreSQL.org" Subject: Re: [SQL] Duplicate tuples with unique index References: <200001252008.PAA20686@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Bruce Momjian wrote: > > > Palle Girgensohn writes: > > > Unfotunately, it doesn't quite work: > > > > > pp=> vacuum analyze; > > > NOTICE: Rel pg_statistic: TID 1/93: OID IS INVALID. TUPGONE 0. > > > VACUUM > > > pp=> delete from pg_statistic; > > > ERROR: heap_delete: (am)invalid tid > > > > Ugh. Yup, your pg_statistic table is corrupted all right. > > > > What you may have to do is pg_dump that database, destroydb/createdb, > > and reload. > > > > I have a possible shortcut for you, but I *strongly* suggest that you > > pg_dump first in case it doesn't work! After making your backup dump, > > stop the postmaster and truncate the broken database's pg_statistic > > file to zero length: > > cp /dev/null .../data/base/yourdb/pg_statistic > > Then restart the postmaster and see if you can vacuum analyze the > > broken database. If so, you are good to go; if not, it's time to > > reload that database. > > > > Running pg_upgrade is another option. Nope. pg_upgrade was "disabled in this release because the internal blahblahblah disk layout changed from previous versions". cat /dev/null > pg_statistic didn't help, and the file was already zero bytes long. Applied the patches to vacuum.c and hio.c, and pg_dumpall && initdb && psql < dump.sql fixed it. Thanks for your support! /Palle