Duplicate primary keys/rows - Mailing list pgsql-general

From CSN
Subject Duplicate primary keys/rows
Date
Msg-id 20051009194652.6743.qmail@web52902.mail.yahoo.com
Whole thread Raw
Responses Re: Duplicate primary keys/rows
List pgsql-general
This is weird. I set up a table with a serial id field
and created a primary key on it. Then I imported data.
Running an app against it, I got periodic errors
stating "duplicate key violates unique constraint
"pkey_table1." Looking through the table (with
phppgadmin), there are duplicate rows:

id|f1|f2|f3|f4
585|c|a|e|f
586|a|b|c|d
586|a|b|c|d
587|g|e|r|z

However:

select * from table1 where id=586;
586|a|b|c|d

Yet:
select * from table1 where id>=585 and id<=587;
585|c|a|e|f
586|a|b|c|d
586|a|b|c|d
587|g|e|r|z

Wow, how is this possible? I'm using PG 8.0.3 on
Windows XP. This computer has been crashing repeatedly
lately, if that could be blamed (bad memory? hard
disk? I haven't quite figured out why.) Using
phppgadmin, I was able to delete one of the duplicate
rows (there are several) - don't know how it does that
- maybe using OIDs?

CSN



__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

pgsql-general by date:

Previous
From: Keary Suska
Date:
Subject: Re: brain-teaser with CONSTRAINT - any SQL experts?
Next
From: Michael Fuhr
Date:
Subject: Re: Duplicate primary keys/rows