Re: pg_restore fails due to foreign key violation

2018-12-11 Thread Olga Vingurt
Tom Lane wrote: > Hm. In theory, that truncation failure in itself shouldn't have caused a > problem --- autovacuum is just trying to remove some empty pages, and if > they don't get removed, they'd still be empty. However, there's a problem > if the pages are empty because we just deleted

Re: pg_restore fails due to foreign key violation

2018-12-10 Thread Olga Vingurt
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

pg_restore fails due to foreign key violation

2018-12-10 Thread Olga Vingurt
Hi, We are using PostgresSQL 9.5.10 and pg_dump/pg_restore to export and import database. We encountered an issue (which is not easily reproducible) when running pg_restore: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 3624; 2606 37504