title: How can I translate a PostgreSQL hstore column into a row?
body: <p>What SQL query will translate a <a href="http://www.postgresql.org/" rel="nofollow">PostgreSQL</a> <a href="http://www.postgresql.org/docs/9.2/static/hstore.html" rel="nofollow">hstore</a> column into a regular table where the distinct keys in all of the hstore rows form the columns in the table and the values fill the rows in the corresponding column?</p>
  
  <p>For example, how can I convert hstore column</p>
  
  <pre><code>hstore
  ------------------------------------
  "a"=&gt;"1", "b"=&gt;"2", "c"=&gt;"3"
  "a"=&gt;"4", "b"=&gt;"6", "c"=&gt;"5", "d"=&gt;7
  "a"=&gt;"8", "b"=&gt;"3", "c"=&gt;"8"
  </code></pre>
  
  <p>into "equivalent" table</p>
  
  <pre><code>a   b   c   d
  ---------------
   1 | 2 | 3 |
   4 | 6 | 5 | 7 
   8 | 3 | 8 |
  </code></pre>
  
  <p>where the distinct hstore keys a, b, c, and d form the columns in the table and their values fill the rows in each column?</p>