Duplicate primary keys/rows

Поиск
Список
Период
Сортировка
От CSN
Тема Duplicate primary keys/rows
Дата
Msg-id 20051009194652.6743.qmail@web52902.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Duplicate primary keys/rows  (Michael Fuhr <mike@fuhr.org>)
Список 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 по дате отправления:

Предыдущее
От: Keary Suska
Дата:
Сообщение: Re: brain-teaser with CONSTRAINT - any SQL experts?
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Duplicate primary keys/rows