Replace content of only one table with new version (should disable foreign keys?)
The deferred constraints solution (see an example in the question) actually works if I make the keys deferrable in normal way. 

This didn't work because I did UPDATE pg_catalog.pg_constraint SET condeferrable = true; but forgot to set the same for pg_catalog.pg_trigger.