title: How to transpose two-dimension arrays in PostgreSQL
body: <p>A table</p>
  
  <pre><code>create table matrices(
   matrix text[][] not null);
  </code></pre>
  
  <p>It's value:     </p>
  
  <pre><code> insert into Matrices values
      (array[ ['1','2','3'],
              ['4','5','6'] ]),
      (array[ ['a','b','c'],
              ['d','e','f'] ]);
  </code></pre>
  
  <p>How Could I write SQL to transpose each array, so that the result looks like:</p>
  
  <pre><code>   matrix
  -------------
  {{1,4},{2,5},{3,6}}
  {{a,d},{b,e},{c,d}}
  (2 rows)
  </code></pre>