title: Metadata from a postgresql-database
body: <p>I want to get data about all relationships from a PostgreSql-database with query like</p>
  
  <pre><code>SELECT
      [creatorUser].[primTableName].[primColumnName] AS primary_column,
      [creatorUser].[foreignTableName].[foreignColumnName] AS foreign_column,
  FROM
      sys.sysidx    si,
      sysidxcol     sic,
      sys.SYSFKCOL  sfc,
      sysusers      su,
      sys.systable  st,
      sys.syscolumn sc
  WHERE
      si.table_id=sic.table_id AND
      si.index_id=sic.index_id AND
      sfc.primary_column_id=sic.primary_column_id AND
      sfc.foreign_table_id=sic.table_id AND
      st.table_id=sfc.foreign_table_id AND
      su.uid=st.creator AND
      sc.column_name=si.index_name
  </code></pre>
  
  <p>Can anybody help, how to get that data? How to be a correct query</p>
  
  <pre><code>owner1.table1.primCol1 owner1.table1.foreignCol1
  owner1.table1.primCol2 owner1.table1.foreignCol2
   ..
  </code></pre>
  
  <p>?</p>