pg_restore: [archiver] could not find entry for ID 12
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