What does "ERROR: failed to find parent tuple for heap-only tuple at (1192248, 5) in table "fruits"" mean?

From: Niels Kristian Schjødt <nielskristian(at)autouncle(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: What does "ERROR: failed to find parent tuple for heap-only tuple at (1192248, 5) in table "fruits"" mean?
Date: 2014-04-09 07:39:58
Message-ID: 5279FCC9-03B8-4BBA-8FF0-5B00B3F1332C@autouncle.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


After being bitten by the bug mentioned in the release notes of 9.3.4, I have realized that a very small part of my data is corrupt, after doing a failover. The bug showed it self as duplicate rows, with the same primary key.
Now I can easily afford to delete some data from my database if that’s what it takes to fix my problem, so I just deleted those duplicates whole hug. After doing this, I decided to write a script that drops/recreates all constraints (Pkeys and Fkeys), in order to validate that no more of my data is corrupt. This worked well, until I bumped into the following error, while creating one of the foreign keys:

ERROR: failed to find parent tuple for heap-only tuple at (1192248,5) in table "fruits"
CONTEXT: SQL statement "ALTER TABLE "pm"."fruits" ADD CONSTRAINT "fruits_pkey" PRIMARY KEY (id)"

What is it, and how do I solve it?

Browse pgsql-general by date

  From Date Subject
Next Message MOHAMMED-BOUZIANE Ilyes 2014-04-09 13:41:46 Help
Previous Message Alberto Cabello Sánchez 2014-04-09 06:24:20 Re: check constraint question