Setting constraint deferrable doesn't work on PostgreSQL transaction
问题 This is the situation: I have two tables where the one references the other (say, table2 references table1). When creating these tables, I did set the foreign key constraint as DEFERRABLE and the ON UPDATE and ON DELETE clauses as NO ACTION (which is the default). But still, when running the transaction below, I get the following error. Transaction: START TRANSACTION; SET CONSTRAINTS ALL DEFERRED; UPDATE table1 SET blah blah; UPDATE table2 SET blah blah; COMMIT; Error: ERROR: update or delete