title: Where is the ON DELETE CASCADE logic being implemented in Django? (PostgreSQL is used)
body: <p>I just need a confirmation for my understanding on <strong>Django's implementation of ON DELETE CASCADE</strong> from you Django experts.</p>
  
  <p>According to the official Django documentation:</p>
  
  <blockquote>
    <p>When Django deletes an object, by default it emulates the behavior of
    the SQL constraint ON DELETE CASCADE -- in other words, any objects
    which had foreign keys pointing at the object to be deleted will be
    deleted along with it.</p>
  </blockquote>
  
  <p>Does the word <strong>"emulate"</strong> imply that the ON DELETE CASCADE logic is actually implemented in Django instead of at the database level? (I looked into my database and all the tables that contains foreign keys have <em>ON DELETE NO ACTION</em> in their definitions.)</p>
  
  <p>If my understanding is correct, is there any way that I can relocate the <em>ON DELETE CASCADE</em> logic from the app layer to the database layer? I am more looking for a proper way, not an hack, of doing this. (Note: I am using PostgreSQL as my backend.)</p>