pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nandakumar M <m.nanda92@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Rows violating Foreign key constraint exists
Date: Fri, 29 Nov 2019 10:23:25 -0500
Message-ID: <13475.1575041005@sss.pgh.pa.us> (raw)
In-Reply-To: <CANcFUu5BRQ956PLi_8v6MidvTr3LOdL-hwnMM_hZdiwsFNC8=g@mail.gmail.com>
References: <CANcFUu45XyGTghD0C8H-y3ySU97YA2PB+4Qyvw9C4Tr6hqY5cw@mail.gmail.com>
	<a193fa767847c1c3d8677b7ff4cb56880d6bece1.camel@cybertec.at>
	<CANcFUu5BRQ956PLi_8v6MidvTr3LOdL-hwnMM_hZdiwsFNC8=g@mail.gmail.com>

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





view thread (9+ messages)  latest in thread

Message-ID: <13475.1575041005@sss.pgh.pa.us>
Permalink:  ../13475.1575041005@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13475.1575041005@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, m.nanda92@gmail.com, laurenz.albe@cybertec.at
  Subject: Re: Rows violating Foreign key constraint exists
  In-Reply-To: <13475.1575041005@sss.pgh.pa.us>
  References: <CANcFUu45XyGTghD0C8H-y3ySU97YA2PB+4Qyvw9C4Tr6hqY5cw@mail.gmail.com> <a193fa767847c1c3d8677b7ff4cb56880d6bece1.camel@cybertec.at> <CANcFUu5BRQ956PLi_8v6MidvTr3LOdL-hwnMM_hZdiwsFNC8=g@mail.gmail.com> <13475.1575041005@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox