We have a postgresql table where we just recently found out that in our of our tables (table name = orders) in production, one of the column would need to change its type from Integer to Bigint. We can't do this directly in the production table so the plan is....
The plan is:
- Create a new table with the same specs as the old table. (orders_temp)
- Create the needed indexes and triggers for the new table
- Change the data type of that particular column from integer to BigInt
- Run a data copy job to copy data from old table to new (including replication when data migration is done)
- Switch table names:
rename orders_temp to orders rename orders to orders_backup
Would this process have any complications?