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>"

Reply via email to