Speeding up Postgresql manual index reset?
Are these databases in the same Postgres Cluster?

If so, you might consider a Foreign Data Wrapper, to create a "connection" to each source database and insert the data directly into the new table: 

CREATE EXTENSION POSTGRES_FDW ;

CREATE SERVER foreign_db 
FOREIGN DATA WRAPPER POSTGRES_FDW 
OPTIONS 
( HOST       'host_name' 
, DBNAME     'database_name' 
, UPDATABLE  'false' 
);

CREATE USER MAPPING FOR fred 
SERVER foreign_db 
OPTIONS ( USER 'fred', PASSWORD 'password' );

CREATE FOREIGN TABLE foreign_old_table 
(
   ... 
)
SERVER foreign_db 
OPTIONS ( TABLE_NAME 'old_table' );


Then; finally

INSERT INTO new_table ( everything, except, pk ) 
SELECT ( everything, except, id ) 
FROM foreign_old_table ;