Re: how could duplicate pkey exist in psql?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: how could duplicate pkey exist in psql?
Дата
Msg-id 20111117122824.GD7623@depesz.com
обсуждение исходный текст
Ответ на how could duplicate pkey exist in psql?  (Yan Chunlu <springrider@gmail.com>)
Список pgsql-general
On Thu, Nov 17, 2011 at 01:19:30PM +0800, Yan Chunlu wrote:
> recently I have found several tables has exactly the same pkey,  here is
> the definition:
> "diggcontent_data_account_pkey" PRIMARY KEY, btree (thing_id, key)

please check:
select thing_id, key, count(*) from diggcontent_data_account group by 1,2 having
count(*) > 1;

this will show if you have really duplicated values.

if you have - the index ( diggcontent_data_account_pkey ) is broken.
Exact reason can vary, any chance this database is hot-backup restored
from different system?

Best regards,

depesz

--
The best thing about modern society is how easy it is to avoid contact with it.
                                                             http://depesz.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: How could I find the last modified procedure in the database?
Следующее
От: "Anibal David Acosta"
Дата:
Сообщение: checkpoints are occurring too frequently