title: What is the Postgresql opposite of the unnest function to create an array from a resultset
body: <p>I have a dept --&lt; emp schema. I want create a resultset which joins dept and emp with a row for each dept and a column which is an array of emps in each dept.</p>
  
  <p>So something like <code>select dept_name, xxxxxxx from dept,emp where emp_dept_id = dept_id</code></p>
  
  <p>returning</p>
  
  <pre><code>department1 | fred,bill,joe
  department2 | faith, hope, charity
  </code></pre>