Re: [HACKERS] Number of tuples (20300) not the same as heap (20301) - Mailing list pgsql-hackers

From G. Anthony Reina
Subject Re: [HACKERS] Number of tuples (20300) not the same as heap (20301)
Date
Msg-id 3725F0DF.CD559BE5@nsi.edu
Whole thread Raw
In response to Re: [HACKERS] Number of tuples (20300) not the same as heap (20301)  ("Tim Perdue" <perdue@raccoon.com>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Matthias Schmitt
Date:
Subject: Re: [HACKERS] Hacker found bug in Postgres ?
Next
From: Taral
Date:
Subject: Re: [HACKERS] Re: CORBA again. (was: light dawns: serious bug in FE/BE protocol handling)