Re: BUG #14874: Dublicate values in primary key

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: sideuxb-ky(dot)consultant(at)dgfip(dot)finances(dot)gouv(dot)fr
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14874: Dublicate values in primary key
Date: 2017-10-26 16:53:55
Message-ID: CAH2-Wz=1TXT55LGfT1XnMvxJYaaoBVk2X8zbHX_oLwQNA5Sk8g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Oct 26, 2017 at 8:16 AM,
<sideuxb-ky(dot)consultant(at)dgfip(dot)finances(dot)gouv(dot)fr> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14874
> Logged by: Henri Ky
> Email address: sideuxb-ky(dot)consultant(at)dgfip(dot)finances(dot)gouv(dot)fr
> PostgreSQL version: 9.4.4
> Operating system: CentOS release 6.5
> Description:
>
> We have serious issue with duplicate values in primary key with our database
> running in PostgreSQL 9.4.4.
> This only occured during about 19 hours and in on table. There were no
> restart of the base before and after the issue, and no error found in
> PostgreSQL logs.
>
> We use sequence to generate automatically the ID of the PK for each data
> row.
> Only the ID of the PK are duplicated, whereas the data of their rows are
> different.

That's a very old point release. Many 9.4 bugs were fixed after the
9.4.4 point release, including ones that could account for this. You
ought to be trying to stay on the latest point release.

You'll clearly need to fix the problem by hand, resolving which rows
to keep. Rows can be deleted by using the hidden ctid column.

I also recommend using this tool to isolate the corruption as you fix it:

https://github.com/petergeoghegan/amcheck

There are CentOS packages available from the PGDG yum repository.

--
Peter Geoghegan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message bouellette 2017-10-26 17:45:09 BUG #14875: pg_createcluster fails to load --createclusterconf
Previous Message sideuxb-ky.consultant 2017-10-26 15:16:11 BUG #14874: Dublicate values in primary key