title: Different set of unnest not showing correctly?
body: <p>Example Data
  Sql fiddle <a href="http://sqlfiddle.com/#!15/c8a17/4" rel="nofollow">http://sqlfiddle.com/#!15/c8a17/4</a></p>
  
  <p>My Query </p>
  
  <pre><code>select
      unnest(array[g,g1,g2]) as disp,
      unnest(array[g,g||'-'||g1,g||'-'||g1||'-'||g2]) as grp,
      unnest(array[1,2,3]) as ord,
      unnest(array['assesvalue','lst2','salesvalue','itemprofit','profitper','itemstockvalue'])as analysis,
      unnest(array[value1,tt,sv,tp,per,tsv])as val 
  from ( 
      select 
          g,
          g1,
          g2,
          sum(value1) as value1,
          sum(tt) as tt,
          sum(sv) as sv,
          sum(tp) as tp,
          sum(per) as per,
          sum(tsv) as tsv 
      from table1 
      group by g,g1,g2
  ) as ta
  </code></pre>
  
  <p>It Show the output like this </p>
  
  <pre><code>disp    grp    ord    analysis             val
  A       A       1       assesvalue          100
  B       A-B     2       lst2                30
  C       A-B-C   3       salesvalue           20
  A       A       1       itemprofit           5
  B       A-B     2       profitper            1
  C       A-B-C   3      itemstockvalue        10
  </code></pre>
  
  <p>Expected Result :</p>
  
  <pre><code>disp    grp    ord      analysis            val
  A       A       1       assesvalue          100
  A       A       1       lst2                30
  A       A       1       salesvalue           20
  A       A       1       itemprofit           5
  A       A       1       profitper            1
  A       A       1       itemstockvalue       10
  B      A-B      2       assesvalue          100
  B      A-B      2       lst2                30
  B      A-B      2       salesvalue           20
  B      A-B      2       itemprofit           5
  B      A-B      2       profitper            1
  B      A-B      2       itemstockvalue       10
  C      A-B-C    3       assesvalue          100
  C      A-B-C    3       lst2                30
  C      A-B-C    3       salesvalue           20
  C      A-B-C    3       itemprofit           5
  C      A-B-C    3       profitper            1
  C      A-B-C    3      itemstockvalue        10
  </code></pre>
  
  <p>In Query i am using multiple <code>unnest</code>. 
  first 3 <code>unnest</code> inside have 3 columns other have 6 columns that its show wrong output but if last 2  <code>unnest</code> have less then 6 its show my expected result.
  what am doing wrong in query??</p>
  
  <p>i am using <strong>postgresql 9.3</strong></p>