We want to modify some columns of text type to integer, while couldn’t find related command.
Hi,
To achieve this we should:
- add a new column of type integer.
UPDATE
the value of the new column across the table with an appropriate cast of the existing text valuesDROP
orRENAME
the old column- optionally
RENAME
the new column
Please check the ALTER TABLE documentation for details on how to do this and feel free to comment or upvote feature request #13874 if you think it would be important to make this process simpler.
Thank you.