How to disable foreign key constraints in Postgres dump file? I used pg_dump -U postgres -p 65432 --table=tableName --data-only --column-inserts DBName&gt;fileName.sql to dump one particular table's rows. Now I need to insert them to another database but I get this error


  insert or update on table "tableName" violates foreign key constraint "tableName_fk1" 


How to proceed by dropping the foreign key contraint?
the command is:

alter table "tableName" drop constraint "tableName_fk1"


The foreign key must already exist in the database where you want to import, since the dump was made --data-only.