title: Postgresql crosstab query with multiple "row name" columns
body: <p>I have a table that is a "tall skinny" fact table:</p>
  
  <pre><code>CREATE TABLE facts(
      eff_date timestamp NOT NULL,
      update_date timestamp NOT NULL,
      symbol_id int4 NOT NULL,
      data_type_id int4 NOT NULL,
      source_id char(3) NOT NULL,
      fact decimal
   /* Keys */
    CONSTRAINT fact_pk
      PRIMARY KEY (source_id, symbol_id, data_type_id, eff_date),
  )
  </code></pre>
  
  <p>I'd like to "pivot" this for a report, so the header looks like this:</p>
  
  <pre><code>eff_date, symbol_id, source_id, datatypeValue1, ... DatatypeValueN
  </code></pre>
  
  <p>I.e., I'd like a row for each unique combination of eff_date, symbol_id, and source_id. </p>
  
  <p>However, the postgresql crosstab() function only allow on key column.</p>
  
  <p>Any ideas?</p>