Re: Rows missing from table despite FK constraint - Mailing list pgsql-general

From Konrad Garus
Subject Re: Rows missing from table despite FK constraint
Date
Msg-id 6645f6441001070558h5eaf6c01oec24392cfff8abe4@mail.gmail.com
Whole thread Raw
In response to Re: Rows missing from table despite FK constraint  (Guillaume Lelarge <guillaume@lelarge.info>)
List pgsql-general
> So, question is: did you disable triggers sometime on the referenced table?

No, at least not intentionally. More information:

 1. Missing are 3 rows added quickly one after another over half a
year ago. They were lost this week. That is the only corruption I am
aware of.

 2. The problem is rows that were present in master table and are
gone, not superfluous rows in slave table.

 3. The master table has this rule preventing DELETE on it:

Rules:
    master_table_no_delete AS
    ON DELETE TO master_table DO INSTEAD  SELECT no_delete() AS no_delete

Where no_delete is:

begin
         raise exception 'Cannot remove rows from the table.';
end;

I am pretty confident it was not caused by us or our software. The
data is relatively old, the missing piece is small and the no_delete
rule is in place.

Can it be a side effect of some PG job, such as vacuum etc?

Let me know what other information could be helpful.

--
Konrad Garus

pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: Rows missing from table despite FK constraint
Next
From: "Gauthier, Dave"
Date:
Subject: Re: interesting check constraint behavior