Re: Rows violating Foreign key constraint exists - Mailing list pgsql-general

From Tom Lane
Subject Re: Rows violating Foreign key constraint exists
Date
Msg-id 13475.1575041005@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rows violating Foreign key constraint exists  (Nandakumar M <m.nanda92@gmail.com>)
Responses Re: Rows violating Foreign key constraint exists
List pgsql-general
Nandakumar M <m.nanda92@gmail.com> writes:
>> It could be that somebody disabled the triggers, but that would have to
>> be a superuser.  And I hope that people randomly disabling system triggers
>> on tables don't have superuser access to your database.

> It is unlikely that this happened. So I am assuming corruption.
> But I am able to query both the referred and referring table
> successfully without any 'missing chunk' or similar errors that
> usually indicate corruption.
> Is it possible that corruption might cause data loss like this without
> any errors?

The most likely "corruption" explanation is something wrong with the
indexes on the referenced and/or referencing column, causing rows to
not be found when referential actions should have found them.  Random
querying of the tables wouldn't necessarily expose that --- you'd need
to be sure that your queries use the questionable indexes, and maybe
even search for some of the specific rows that seem mis-indexed.

            regards, tom lane



pgsql-general by date:

Previous
From: Nandakumar M
Date:
Subject: Re: Rows violating Foreign key constraint exists
Next
From: Alexander Farber
Date:
Subject: Counting booleans in GROUP BY sections