Re: how could duplicate pkey exist in psql?

From: Yan Chunlu <springrider(at)gmail(dot)com>
To: Edson Richter <richter(at)simkorp(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how could duplicate pkey exist in psql?
Date: 2011-11-17 11:21:40
Message-ID: CAOA66tF6522yF4EbC72X7zKhV=AMQhGV4peqJDsqW0MdFLMWCA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am using pgpool's replication feature, it does copy pg_xlog from one
server to another, was that possible cause of the problem?

thanks for the help!

On Thu, Nov 17, 2011 at 5:38 PM, Edson Richter <richter(at)simkorp(dot)com(dot)br>wrote:

>
> 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.
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-general<http://www.postgresql.org/mailpref/pgsql-general>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pedro Doria Meunier 2011-11-17 11:40:36 upgrading from 8.3 to 9.0
Previous Message Yan Chunlu 2011-11-17 11:18:24 Re: how could duplicate pkey exist in psql?