pg_restore: [archiver] could not find entry for ID 12 I'm trying to restore a dump (-Fd --data-only) from PostgreSQL v9.4.9, but I've come across the following error:

pg_restore: [archiver] could not find entry for ID 12


Exactly the same happens if pg_dump is invoked using -Fc instead of -Fd.

As per this link, this seems to be a known issue, but I'm not sure of the workaround I should apply to move over it.

Could this actually be overcome in this PostgreSQL version? If so, what should I alter to achieve it?
You need to identify in which table its throwing this error.


Are you taking full database dump or single table?


Anyhow Try this workaround.


Take schema dump alone.    

pg_dump -O -s dbname &gt; schema.sql
Restore it on the target.
psql -h host -U user -d &lt; schema.sql
On target disable trigger on all the tables.


ALTER TABLE table_name Disable TRIGGER ALL;

Use this query to generate this statement for all the tables.

SELECT 'ALTER TABLE ' 
       || table_name 
       || ' DISABLE TRIGGER ALL;' 
FROM   information_schema.TABLES 
WHERE  table_catalog = 'dbname' -- replace with your db name
       AND table_schema IN( 'public' );  -- add all your schema



Then take the data only dump.


pg_dump -U user dbname -Fc --data-only &gt; dbname.dump


Then restore your backup.


pg_restore -h host -U user dbname &lt; dbname.dump

To make the restore fast, use -j

pg_restore -h host -U user -j 10 dbname &lt; dbname.dump