Re: pg_restore fails due to foreign key violation - Mailing list pgsql-general

From Olga Vingurt
Subject Re: pg_restore fails due to foreign key violation
Date
Msg-id CAOkHHZKZ_HGw56OiBAN9s9ZT8o42rH4vriCHPOeYAYdp=jwsfQ@mail.gmail.com
Whole thread Raw
In response to pg_restore fails due to foreign key violation  (Olga Vingurt <olga.vingurt@gmail.com>)
Responses Re: pg_restore fails due to foreign key violation
List pgsql-general
The data indeed wasn't consistent on the source system and foreign key index was corrupted.
After manually cleaning not relevant records and running REINDEX on the table pd_dump and pg_restore worked as expected.

The only question left is how we got into corrupted data state.
In the event logs (PorstgeSQL is runnign on Wondows Server) we found error which looks relevant:
 
ERROR:  could not truncate file "base/12373/17254" to 19 blocks: Permission denied
CONTEXT:  automatic vacuum of table "postgres.public.<table_name>"

pgsql-general by date:

Previous
From: Ron
Date:
Subject: What is the tuplestore?
Next
From: Tom Lane
Date:
Subject: Re: pg_restore fails due to foreign key violation