title: how to split a column that is created with array_agg
body: <p>I'm trying to split up an arrayed column that was created using an array_agg.  the following is severely cut down, original query is something like 210 lines</p>
  
  <pre><code>select 
   distinct on (visitor.id)
   id,
   array_agg(distinct item.code::text)
  
  from
   8xfullouter joins
  
  where
  exists(
  select
  distinct on(visitor.id)
  item.code::text
  from
  3 full outer join that all appear in the first query
  
  group by
  visit.id, 
  item.code
  
  order by 
  visit.id
  )
  </code></pre>
  
  <p>I need to break the array_agg(distinct item.code::text)  into multiple columns.  I've tried split_part(array_agg(distinct item.code::text), ',', 1) but received the following</p>
  
  <pre><code>&gt; [Err] ERROR:  function split_part(character varying[], unknown,
  &gt; integer) does not exist LINE 159: split_part (array_agg(distinct
  &gt; "public".procedure_group_cpt_...
  </code></pre>
  
  <p>thanks!!!</p>