title: Postgres - aggregate two columns into one item
body: <p>I would like to aggregate two columns into one "array" when grouping.</p>
  
  <p>Assume a table like so:</p>
  
  <pre><code>friends_map:
  =================================
  user_id    friend_id    confirmed
  =================================
  1          2            true
  1          3            false
  2          1            true
  2          3            true
  1          4            false
  </code></pre>
  
  <p>I would like to select from this table and group by user_id and get friend_id and confirmed as a concatenated value separated by a comma.</p>
  
  <p>Currently I have this:</p>
  
  <pre><code>SELECT user_id, array_agg(friend_id) as friends, array_agg(confirmed) as confirmed
  FROM friend_map
  WHERE user_id = 1
  GROUP BY user_id
  </code></pre>
  
  <p>which gets me:</p>
  
  <pre><code>=================================
  user_id    friends      confirmed
  =================================
  1         [2,3,4]       [t, f, f]
  </code></pre>
  
  <p>How can I get:  </p>
  
  <pre><code>=================================
  user_id    friends     
  =================================
  1         [ [2,t], [3,f], [4,f] ]
  </code></pre>