Finalmente fiz assim:
-
Exportar para despejar com:
pg_dump -f dumpfile.sql --column-inserts -a -n <schema> -U <username> <dbname>
-
Definir salto exclusivo para todas as tabelas
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
-
Importar compsql
\i <dumpfile.sql>