title: postgres rows to 2 dimensional array
body: <p>Is there any easy way of converting a postgres table in to an 2 dimensional?</p>
  
  <p>I have a data table foobar with two columns foo and bar which has the following data in 
  1,2
  3,4
  5,6</p>
  
  <p>I want to convert it in </p>
  
  <pre><code>{ 
  {1,2},
  {3,4},
  {5,6}
  }
  </code></pre>
  
  <p>I have tried things like</p>
  
  <p>select ARRAY[foo,bar] from foobar</p>
  
  <p>which creates</p>
  
  <pre><code>{1,2}
  {3,4}
  {5,6}
  </code></pre>
  
  <p>Which is nearly there </p>
  
  <p>I suspect that I am going to have to write pgpsql function to do this?  Any suggestions?</p>