Re: how could duplicate pkey exist in psql?

Поиск
Список
Период
Сортировка
От Edson Richter
Тема Re: how could duplicate pkey exist in psql?
Дата
Msg-id 4EC4D60E.9010005@simkorp.com.br
обсуждение исходный текст
Ответ на how could duplicate pkey exist in psql?  (Yan Chunlu <springrider@gmail.com>)
Ответы Re: how could duplicate pkey exist in psql?  (Yan Chunlu <springrider@gmail.com>)
Список pgsql-general
Em 17-11-2011 03:19, Yan Chunlu escreveu:
> 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)
>
>
> the data is like this:
>
>    159292 | funnypics_link_point       | 41
>
>                     | num
>    159292 | funnypics_link_point       | 40
>
>                     | num
>
>
> I could not even update this record.
>
> really confused about how could this happen... thanks!

I know one scenario this can happen on Linux. In my case, it was caused
by a "rsync"... instead copy to a different location, script was copying
pg_xlog over own pg_xlog.

I did this stupidity once, and learned for a life time. Lost two hours
of work to recover everything (from backup, at least I had one).

Be careful with rsync and cp, since Linux does not block files from
being overwriten even when they are in use.


Regards,

Edson.


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

Предыдущее
От: Siva Palanisamy
Дата:
Сообщение: Re: How to lock and unlock table in postgresql
Следующее
От: Emanuel Araújo
Дата:
Сообщение: connection manager pgpool... help