# Does CrateDB support modify type of column?

**URL:** <https://community.cratedb.com/t/does-cratedb-support-modify-type-of-column/1727>\
**Category:** CrateDB\
**Created:** [February 28, 2024, 3:09am UTC](https://community.cratedb.com/t/does-cratedb-support-modify-type-of-column/1727 "2024-02-28T03:09:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jun\_Zhou](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jun_zhou/32/1079_2.png) [@Jun\_Zhou](https://community.cratedb.com/u/Jun_Zhou)\
**Post date:** [February 28, 2024, 3:09am UTC](https://community.cratedb.com/t/does-cratedb-support-modify-type-of-column/1727/1 "2024-02-28T03:09:56Z")

</div>

We want to modify some columns of text type to integer, while couldn’t find related command.

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [February 28, 2024, 8:28am UTC](https://community.cratedb.com/t/does-cratedb-support-modify-type-of-column/1727/2 "2024-02-28T08:28:54Z")

</div>

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 values
- `DROP` or `RENAME` the old column
- optionally `RENAME` the new column

Please check the [ALTER TABLE documentation](https://cratedb.com/docs/crate/reference/en/5.6/sql/statements/alter-table.html) for details on how to do this and feel free to comment or upvote [feature request #13874](https://github.com/crate/crate/issues/13874) if you think it would be important to make this process simpler.

Thank you.
