title: How to disable foreign key constraints in postgresql
body: <p>I'm using AWS Aurora Postgres and using DMS to migrate from RDS postgres to Aurora PG. In order to perform the FULL LOAD I want to disable foreign key constraints and triggers on all the objects. I'm able to disable triggers but couldn't find a way to disable constraints.</p>
  
  <p>Below doesn't work: </p>
  
  <p>ALTER TABLE so_items DISABLE CONSTRAINT so_items_so_id_fkey;</p>
  
  <p>It throws: </p>
  
  <blockquote>
    <p>ERROR:  syntax error at or near "CONSTRAINT"
    LINE 1: ALTER TABLE so_items DISABLE CONSTRAINT so_items_so_id_fkey;
                                         ^
    SQL state: 42601
    Character: 30</p>
  </blockquote>
  
  <p>Setting "session_replication_role" = "replica" in the parameter group didn't work. While the DMS task tries to truncate the table part of preparation it still fails with foreign key violation errors. </p>
  
  <p>Please advise any workarounds.</p>
  
  <p>Note: I couldn't do below since in RDS I do not have permissions to do so even with master account: </p>
  
  <pre><code>alter table so_items disable trigger ALL;
  </code></pre>
  
  <blockquote>
    <p>ERROR:  permission denied: "RI_ConstraintTrigger_c_16520" is a system trigger
    SQL state: 42501</p>
  </blockquote>