title: PostgreSQL: Copy data into another column with different data type
body: <p>I am new to PostgreSQL. Now I have a table containing several columns. There are two columns I'm dealing with: <em>city</em> and <em>city_bak</em>. <em>city_bak</em> is of type integer and stores data of cities. The <em>city</em> column is currently null and is of type integer[]. What I want to do is to copy data from <em>city_bak</em> into <em>city</em>. Like this:</p>
  
  <p>[PREVIOUS]</p>
  
  <pre><code> |  city  |  city_bak  |
   |        |    100     |
   |        |    700     |
   |        |    1800    |
  </code></pre>
  
  <p>[AFTER]</p>
  
  <pre><code> |  city  |  city_bak  |
   | {100}  |    100     |
   | {700}  |    700     |
   | {1800} |    1800    |
  </code></pre>
  
  <p>Normally when the two columns are of the same data type, I'd use</p>
  
  <pre><code>UPDATE {table_name} SET city=city_bak
  </code></pre>
  
  <p>But now they are different. How can I copy data in this scenario?
  Thanks in advance.</p>