title: How to use array_agg() for varchar[]
body: <p>I have a column in our database called <code>min_crew</code> that has varying character arrays such as <code>'{CA, FO, FA}'</code>.</p>
  
  <p>I have a query where I'm trying to get aggregates of these arrays without success:</p>
  
  <pre><code>SELECT use.user_sched_id, array_agg(se.sched_entry_id) AS seids
       , array_agg(se.min_crew) 
  FROM base.sched_entry se
     LEFT JOIN base.user_sched_entry use ON se.sched_entry_id = use.sched_entry_id
  WHERE se.sched_entry_id = ANY(ARRAY[623, 625])
  GROUP BY user_sched_id;
  </code></pre>
  
  <p>Both 623 and 625 have the same <code>use.user_sched_id</code>, so the result should be the grouping of the seids and the <code>min_crew</code>, but I just keep getting this error:</p>
  
  <blockquote>
  <pre><code>ERROR:  could not find array type for data type character varying[]
  </code></pre>
  </blockquote>
  
  <p>If I remove the <code>array_agg(se.min_crew)</code> portion of the code, I do get a table returned with the <code>user_sched_id = 2131</code> and <code>seids = '{623, 625}'</code>.</p>