Ik heb het uiteindelijk op deze manier gedaan:
-
Exporteren om te dumpen met:
pg_dump -f dumpfile.sql --column-inserts -a -n <schema> -U <username> <dbname> -
Overslaan uniek instellen voor alle tafels
CREATE OR REPLACE RULE skip_unique AS ON INSERT TO <table> WHERE (EXISTS (SELECT 1 FROM <table> WHERE users.id = new.id)) DO INSTEAD NOTHING -
Importeren met
psql\i <dumpfile.sql>