title: Update column from integer[] to jsonb[]
body: <p>First off, for this I'm using Elixir (Ecto) but I think I'll be better off running a raw SQL statement on the migration.</p>
  
  <p>I have a column which is an array of integers; due to requirement changes I need to convert this array of integers to an array of objects, <code>jsonb[]</code> in this case. This isn't looking quite right for me since converting from <code>integer[]</code> to <code>jsonb[]</code> is not possible (At least not automatically)</p>
  
  <p>I've been trying to cast both types but its just not resulting; I've even tried to convert to string then to jsonb but that doesn't seem to work.</p>
  
  <p>Now I'm looking for the best way to do this, not the simplest, just the best or correct way to do this. I was thinking about creating a temp column, copying the values from the old column there and renaming maybe? What would be the correct SQL statement for this? </p>
  
  <p>By the way, I'm getting hit by this hint too <code>hint: You might need to specify "USING table_name::jsonb[]"</code> but using <code>USING column_name::jsonb[]</code> does not do the trick, neither <code>CAST (column_name as jsonb)</code>.</p>
  
  <p>If it was as simple as I thought it would work with <code>ALTER TABLE table_name ALTER COLUMN column_name TYPE jsonb[] USING column_name::jsonb[]</code>. Let me know if I've not provided enough information, thanks.</p>