Re: Violation of primary key constraint - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Violation of primary key constraint
Date
Msg-id 26306.1359761564@sss.pgh.pa.us
Whole thread Raw
In response to Re: Violation of primary key constraint  (Toby Murray <toby.murray@gmail.com>)
List pgsql-bugs
Toby Murray <toby.murray@gmail.com> writes:
> On Fri, Feb 1, 2013 at 3:58 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> It's conceivable that this was a software glitch not a hardware glitch,
>> ie Postgres forgetting the dirty-bits for a batch of pages, but we've
>> not seen any similar reports elsewhere.  So I'm leaning to the hardware
>> explanation.

> Roger that. Unless there is anything else to look at with the database
> in its current state, I will try to delete the duplicates and then
> backtrack my OSM replication process back to the 28th so that any
> other errors that may have gotten in during the botched write are
> redone.

I wish I could think of something else to look at, but right now
I can't.  You might as well revert the database.  I'd suggest REINDEXing
all the indexes too, since the theory of some dropped page updates would
imply that the indexes are probably not in sync.

It might be worth cranking up logging (eg log_statement = all),
so that if this does happen again, we'll have more to go on.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Toby Murray
Date:
Subject: Re: Violation of primary key constraint
Next
From: Dean Rasheed
Date:
Subject: Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center