Re: Table with seemingly duplicated primary key values - Mailing list pgsql-general

From Tom Lane
Subject Re: Table with seemingly duplicated primary key values
Date
Msg-id 13281.1450798404@sss.pgh.pa.us
Whole thread Raw
In response to Table with seemingly duplicated primary key values  (Aleksander Łukasz <allllllx@gmail.com>)
List pgsql-general
=?UTF-8?Q?Aleksander_=C5=81ukasz?= <allllllx@gmail.com> writes:
> a table in our database with about 3 million rows ended up in a state
> where its seems to have duplicated entries (duplicated primary key values):
> ...
> Do you have any idea what could be happening and what measures should be
> undertaken to fix this issue? Thanks.

Looks like corruption of the primary key index.  Try REINDEXing that
index.  This might fail if there actually are duplicate rows in the table
and not just incorrect pointers to them in the index, in which case you'll
have to clean up the duplicates somehow and try again till the REINDEX
succeeds.

            regards, tom lane


pgsql-general by date:

Previous
From: Aleksander Łukasz
Date:
Subject: Table with seemingly duplicated primary key values
Next
From: Melvin Davidson
Date:
Subject: Re: Table with seemingly duplicated primary key values