title: Changing a column from string to string array in postgresql
body: <p>The following is a snippet of a table called "containers".</p>
  
  <pre><code>       Column       |            Type             |            Modifiers            
  --------------------+-----------------------------+---------------------------------
   id                 | uuid                        | not null
   name               | character varying(255)      | 
   products           | character varying           | default '{}'::character varying
  </code></pre>
  
  <p>How can I alter the <code>products</code> column to <code>"character varying[]"</code> and the corresponding modifiers to <code>default '{}'::character varying[]</code> ? Essentially, I want to convert a string to a string array. Note the products column has no limit on the number of characters.</p>
  
  <pre><code>alter table "containers" alter "products" type character varying[];
  </code></pre>
  
  <p>throws the following error </p>
  
  <blockquote>
    <p>ERROR:  column "products" cannot be cast to type character varying[]</p>
  </blockquote>