Received: from nsi.edu (amethea.nsi.edu [198.133.185.9]) by hub.org (8.9.3/8.9.1) with ESMTP id NAA28202 for ; Tue, 27 Apr 1999 13:16:03 -0400 (EDT) (envelope-from reina@nsi.edu) Received: from nsi.edu (o21.nsi.edu [204.128.156.216]) by nsi.edu (8.9.1/8.9.1) with ESMTP id KAA14118; Tue, 27 Apr 1999 10:15:49 -0700 (PDT) Sender: reina@nsi.edu Message-ID: <3725F0DF.CD559BE5@nsi.edu> Date: Tue, 27 Apr 1999 10:16:16 -0700 From: "G. Anthony Reina" Organization: The Neurosciences Institute X-Mailer: Mozilla 4.07C-SGI [en] (X11; I; IRIX 6.5 IP32) MIME-Version: 1.0 To: Tim Perdue CC: pgsql-hackers@postgreSQL.org Subject: Re: [HACKERS] Number of tuples (20300) not the same as heap (20301) References: <001801be904c$abcdd460$0b8c5aa5@timnt.weather.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tim Perdue wrote: > I see this problem all the time too. There are some scary bugs in the bowels > of the code that controls indexes and primary keys. > > At this point, I have like 4000 duplicated primary keys, and I cannot update > sections of the table due to key violations. > > Tim Perdue > PHPBuilder.com / GotoCity.com / Geocrawler.com > My co-worker fixed the table in question but the fix was kind of kludgy. He performed a select on the table and outputted it to a text file. Then he wrote a C program to search the text file for cases of two or more datasets in any primary key. He then deleted the extra datasets with this search list. Lastly, he vacuumed the corrected table. (Apparently, our searching on this table was extremely slow because the vacuum doesn't work if you get this type of error). Maybe you could find a similar fix for your table. Hopefully, some of the hackers will be able to find the problem in the code. Otherwise, the db works very well. -Tony