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