title: Postgresql truncate table with foreign key constraint
body: <p>Currently I am trying to truncate tables which have foreign key constraint on Postgresql 11.3.</p>
  
  <p>I tried doing this </p>
  
  <pre><code>BEGIN; 
  SET CONSTRAINTS ALL DEFERRED;
  TRUNCATE tableA;
  COMMIT;
  </code></pre>
  
  <p>but received error</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>Doesn't <code>SET CONSTRAINTS ALL DEFERRED</code> 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?</p>