title: NOT DEFERRABLE versus DEFERRABLE INITIALLY IMMEDIATE
body: <p>I read this about the SQL keyword <code>DEFERRABLE</code> in <em>Database Systems - The Complete Book</em>.</p>
  <blockquote>
  <p>The latter <em>[NOT DEFERRABLE]</em> is default, and means that every time a database modification statement is executed, the constraint is checked immediately afterwards, if the modification could violate the foreign-key constraint.</p>
  <p>However, if we declare a constraint to be <strong>DEFERRABLE</strong>, then we have the option of having it wait until a transaction is complete before checking the constraint.</p>
  <p>We follow the keyword <strong>DEFERRABLE</strong> by either <strong>INITIALLY DEFERRED</strong> or <strong>INITIALLY IMMEDIATE</strong>. In the former case, checking will be deferred to just before each transaction commits. In the latter case, the check will be made immediately after each statement.</p>
  </blockquote>
  <p>How is <code>NOT DEFERRABLE</code> different from <code>DEFERRABLE INITIALLY IMMEDIATE</code>? In both cases, it seems, any constraints are checked after each individual statement.</p>