title: Storing a complete graph in a RDBMS
body: <p>I have several types of entities, each with their own fields, which are stored in separate tables.<br>
  Each record in such a table may be connected to zero or more records in a different table, i.e., linked to records from different entity types.<br>
  If I go with lookup tables, I get (m(m-1))/2=O(m^2) separate lookup tables that need to be initialized.<br>
  While still feasible for 6 or 7 different entity types, would it still be relevant for 50+ such types?<br>
  In particular, a given record would need to have links to most other entity types so theoretically speaking I would be dealing with a nearly-complete, non-directed, n-sided graph.<br>
  Can anyone shed some light on how to store this structure in a relational DBMS?<br>
  (I'm using Postgresql if it matters, but any solutions for other DBMS's would be equally helpful).<br>
  Thank you for your time!</p>
  
  <p>Yuval   </p>