BUG #9895: Duplicate pkey

Started by Niels Kristian Schjødtabout 12 years ago3 messagesbugs
Jump to latest
#1Niels Kristian Schjødt
nk.schjoedt@gmail.com

The following bug has been logged on the website:

Bug reference: 9895
Logged by: Niels Kristian
Email address: nk.schjoedt@gmail.com
PostgreSQL version: 9.3.4
Operating system: Ubuntu
Description:

Hi I just realized that my data contains a few duplicate primary keys! There
has ALWAYS been a PRIMARY KEY constraint on those ID's. The affected records
might have been created while running a previous version of postgresql.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Michael Paquier
michael@paquier.xyz
In reply to: Niels Kristian Schjødt (#1)
Re: BUG #9895: Duplicate pkey

On Mon, Apr 7, 2014 at 8:57 PM, <nk.schjoedt@gmail.com> wrote:

Hi I just realized that my data contains a few duplicate primary keys! There
has ALWAYS been a PRIMARY KEY constraint on those ID's. The affected records
might have been created while running a previous version of postgresql.

9.3.4 has fixed a data corruption issue in WAL replay that could
create inconsistent query results when using an index on a standby.
This could lead to violations of primary keys for example. Perhaps you
have been bitten by that:
http://www.postgresql.org/docs/devel/static/release-9-3-4.html
When updating to 9.3.4 it is recommended to replace all the standbys
by a new base backup after the update.
Regards,
--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3Niels Kristian Schjødt
nk.schjoedt@gmail.com
In reply to: Michael Paquier (#2)
Re: BUG #9895: Duplicate pkey

Thanks, that is most defiantly the case.

What is the best approach on doing a loop of re-checking of all my constraints (pkeys, fkeys) -> fixing issues -> checking again, to make sure that my data is OK?

Den 08/04/2014 kl. 02.22 skrev Michael Paquier <michael.paquier@gmail.com>:

On Mon, Apr 7, 2014 at 8:57 PM, <nk.schjoedt@gmail.com> wrote:

Hi I just realized that my data contains a few duplicate primary keys! There
has ALWAYS been a PRIMARY KEY constraint on those ID's. The affected records
might have been created while running a previous version of postgresql.

9.3.4 has fixed a data corruption issue in WAL replay that could
create inconsistent query results when using an index on a standby.
This could lead to violations of primary keys for example. Perhaps you
have been bitten by that:
http://www.postgresql.org/docs/devel/static/release-9-3-4.html
When updating to 9.3.4 it is recommended to replace all the standbys
by a new base backup after the update.
Regards,
--
Michael

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs