title: Foreign keys + table inheritance in PostgreSQL?
body: <p>I have three tables: <code>organization</code>, <code>organization_teams</code> and <code>org_users</code>. Here <code>organization_teams</code> is inherited from <code>organization</code>. So suppose if a record is added in <code>organizations_teams</code> it will get the <code>organization</code> table <code>id</code> as value for <code>id</code> column in <code>organization_teams</code>. </p>
  
  <p><code>org_users</code> has foreign key on <code>id</code> column of <code>organization</code>. Now when I try to insert data in <code>org_users</code> it giving me error as below</p>
  
  <pre><code>insert or update on table "org_users" violates foreign key constraint "org_users_organizations"
  DETAIL:  Key (org_id)=(12) is not present in table "organizations"
  </code></pre>
  
  <p>Why?</p>