title: duplicated foreign key constraints - reasons for or against
body: <p>I've just come across a table in production which has 4 foreign key constraints.  Two of the constraints are exact duplicates of the other two.</p>
  
  <p>ie</p>
  
  <pre><code>fk1(a_id) references a(id)
  fk2(a_id) references a(id)
  fk3(b_id) references b(id)
  fk4(b_id) references b(id)
  </code></pre>
  
  <p>I have never seen this before ... it strikes me as being quite wrong and my gut feeling is there must be a performance hit here (esp on inserting in to this table).  In this instance the database is PostGres but I'm interested in what people think the general behaviour would be.</p>
  
  <p>And if anyone's experienced a time where you'd want foreign keys like this I'd also be interested - especially because I'm going to suggest getting rid of the duplicates!</p>