sql/schemachanger: Enable column type changes for virtual computed columns #135315
+356
−37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This update introduces support for altering the column type of virtual computed columns in the declarative schema changer (DSC). Previously, such operations were not allowed.
A key characteristic of virtual columns is that type changes never require a backfill or column rewrite, as their values are computed dynamically during access. This change includes adjustments to handle type changes that would typically involve a rewrite as simple metadata updates instead.
Additionally, the USING expression in ALTER TABLE statements is now explicitly disallowed for virtual columns, as no data rewriting occurs. Attempts to use this option will result in an error.
Epic: CRDB-25314
Closes: #125840
Release note: none