Re: Rows missing from table despite FK constraint

From: Konrad Garus <konrad(dot)garus(at)gmail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rows missing from table despite FK constraint
Date: 2010-01-07 13:58:54
Message-ID: 6645f6441001070558h5eaf6c01oec24392cfff8abe4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2010-01-07 14:22:03 Re: interesting check constraint behavior
Previous Message Guillaume Lelarge 2010-01-07 13:47:42 Re: Rows missing from table despite FK constraint