Currently I am trying to truncate tables which have foreign key constraint on Postgresql 11.3.
I tried doing this
BEGIN;
SET CONSTRAINTS ALL DEFERRED;
TRUNCATE tableA;
COMMIT;
but received error
ERROR: cannot truncate a table referenced in a foreign key constraint
DETAIL: Table "xxx" references "tableA".
HINT: Truncate table "xxx" at the same time, or use TRUNCATE ... CASCADE.
Doesn't SET CONSTRAINTS ALL DEFERRED would turn off the foreign key constraint check? Are there anyway to truncate a table without triggering foreign key constraint check and not involving CASCADE?