Jonathan Du
05/18/2026, 1:50 AMRocky
05/18/2026, 1:50 AMALTER TABLE includes [ DEFAULT "<default_value>"] in the syntax for MODIFY COLUMN, there is a significant limitation: StarRocks does not currently support changing the default value of an existing column.
The error message Can not change default value occurs because the "Schema Change" process in StarRocks (which handles column modifications) is designed to handle data type conversions and reordering, but it does not support updating the metadata for the DEFAULT attribute of a column once it has been created.
Key Points:
* Documentation vs. Reality: The documentation suggests you can specify a DEFAULT value during a MODIFY COLUMN operation. However, this is typically required only to restate the existing default value if you are changing the column's data type. If you attempt to change the value itself, the system returns the error you encountered.
* Version Limitation: This is a known behavior across most current versions (including 2.x and 3.x). While "Fast Schema Evolution" (introduced in v3.1+) has made adding and dropping columns faster, it has not yet enabled the modification of default values for existing columns.
* Primary Key Tables: This limitation is particularly strict for Key columns and columns in Primary Key tables.
Recommended Workarounds:
If you need to change the default value for a column, you generally have two options:
1. Add a New Column (Recommended):
* Add a new column with the desired default value:
sql
ALTER TABLE your_table ADD COLUMN new_col_name column_type DEFAULT "new_default_value";
* If necessary, update the new column with data from the old column:
sql
UPDATE your_table SET new_col_name = old_col_name;
* Drop the old column and rename the new one (Note: Column renaming is supported from v3.3.2 onwards):
sql
ALTER TABLE your_table DROP COLUMN old_col_name;
ALTER TABLE your_table RENAME COLUMN new_col_name old_col_name;
2. Recreate the Table:
For smaller tables or during development, the simplest path is to export the data, drop the table, and recreate it with the correct column definition.
For more details on schema change limitations, you can refer to the StarRocks ALTER TABLE documentation.
References
• administration/management/FE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md