Re: Rows missing from table despite FK constraint

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Konrad Garus *EXTERN*" <konrad(dot)garus(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Rows missing from table despite FK constraint
Date: 2010-01-07 13:23:49
Message-ID: D960CB61B694CF459DCFB4B0128514C203938114@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Konrad Garus wrote:
> We use PG 8.3. We use pg_dump and pg_restore overnight to create
> copies of main database for reporting etc. One dump/restore runs at 9
> PM, another at 11 PM.
>
> Today I discovered that the restore at 11 PM failed to recreate a
> foreign key constraint, because one row from master table was missing.
> It is also missing from main database, but not from the 9 PM dump.
>
> The main database is in curious state: The row from master table is
> missing, the row referencing it from slave table is present, and
> finally the FK constraint on slave is in place.
>
> Do you have any ideas on how it could possibly happen? What research
> could help find the root cause and fix the database?

If that's really the case, it sounds like curruption.

Is there anything in the server logs?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Konrad Garus 2010-01-07 13:31:47 Re: Rows missing from table despite FK constraint
Previous Message Merlin Moncure 2010-01-07 13:18:18 Re: How psql source code can be protected?