Re: pg_restore fails due to foreign key violation

From: Olga Vingurt <olga(dot)vingurt(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_restore fails due to foreign key violation
Date: 2018-12-10 16:43:17
Message-ID: CAOkHHZKZ_HGw56OiBAN9s9ZT8o42rH4vriCHPOeYAYdp=jwsfQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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>"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2018-12-10 17:33:13 Re: pg_restore fails due to foreign key violation
Previous Message Ron 2018-12-10 15:56:05 What is the tuplestore?