Disable PostgreSQL foreign key checks for migrations

For migration, it is easier to disable all triggers with:

SET session_replication_role="replica";

And after migration reenable all with

SET session_replication_role="origin";

Leave a Comment