Row exists in a table that violates Foreign key constraint

From: Nandakumar M <m(dot)nanda92(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Row exists in a table that violates Foreign key constraint
Date: 2018-08-17 15:40:34
Message-ID: CANcFUu64QQdptZoE43+QYcPoJ-1yyyZQrOgf-7DcdgLeg-gc9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

I have a table with a FK constraint to another table. There exists one row
on the referring table with no corresponding row on the referred table. I
tried validating the constraint but that did not produce any errors. This
is on a older version of Postgres (9.2.4)

Please find attached the query outputs showing the issue.

On checking postgres bugs mailing list found that the issue I am facing is
exactly the same as the one mentioned below.

https://www.postgresql.org/message-id/200704191356.l3JDufEo052753%40wwwmaster.postgresql.org

I have not done any VACUUM FULL on the table as suggested on this thread
though. It would be great if someone can confirm if this is an identified
issue and also let me know how to fix the inconsistency.

If any other information is needed for further analysis I can share the
same.

Regards,
Nanda

Attachment Content-Type Size
pg_fk_bug.txt text/plain 3.4 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Gierth 2018-08-17 15:44:46 Re: BUG #15336: Wrong cursor's bacward fetch results in select with ALL(subquery)
Previous Message Tom Lane 2018-08-17 14:53:11 Re: BUG #15333: pg_dump error on large table -- "pg_dump: could not stat file...Unknown error"