Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Support ALTER COLUMN type that does not require on-disk changes #4424

Closed
ndeodhar opened this issue May 8, 2020 · 2 comments
Closed
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)

Comments

@ndeodhar
Copy link
Contributor

ndeodhar commented May 8, 2020

We don't support ALTER COLUMN type today. The main reason for this is that altering data type may require changing on-disk data for existing rows. However, there are some variants that don't require on-disk changes. For example, changing column type from varchar(50) to varchar(255). We should add support for such changes.

@ndeodhar ndeodhar added the area/ysql Yugabyte SQL (YSQL) label May 8, 2020
@ndeodhar ndeodhar self-assigned this May 8, 2020
hulien22 added a commit that referenced this issue Aug 4, 2020
#4424)

Summary:
Enabling AT_AlterColumnType allowing for altering column types when they don't require on-disk changes
Specifically only allowing alter column type for `varchar(n)` and `varbit(n)` types, or if no change would occur (ie setting to the exact same type).

Test Plan: Added tests to `yb_feature_alter_table.sql`.

Reviewers: neha, mihnea

Reviewed By: mihnea

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D8880
@hulien22
Copy link
Contributor

hulien22 commented Aug 4, 2020

Closed by ac0eb93.

@hulien22 hulien22 closed this as completed Aug 4, 2020
hulien22 added a commit that referenced this issue Aug 6, 2020
Summary:
Fixing part of o.y.pg.PgForeignKey.PgRegr that was broken in commit ac0eb93.
Also fixing the o.y.pg.PgRegrFeature test.

Test Plan:
ybd --java-test 'org.yb.pgsql.TestPgForeignKey#testPgRegress'
ybd --java-test org.yb.pgsql.TestPgRegressFeature

Reviewers: neha, mihnea, jason

Reviewed By: jason

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9100
@kmuthukk
Copy link
Collaborator

This fix addresses most commonly use variants of ALTER TABLE ALTER COLUMN TYPE (#1013), such as the ones used Django framework.

hulien22 added a commit that referenced this issue Sep 2, 2020
…re on-disk changes (#4424)

Summary:
Enabling AT_AlterColumnType allowing for altering column types when they don't require on-disk changes
Specifically only allowing alter column type for `varchar(n)` and `varbit(n)` types, or if no change would occur (ie setting to the exact same type).

Test Plan: Jenkins: rebase: 2.2

Reviewers: neha, mihnea

Reviewed By: mihnea

Subscribers: bogdan, kannan, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9233
hulien22 added a commit that referenced this issue Sep 2, 2020
Summary:
Fixing part of o.y.pg.PgForeignKey.PgRegr that was broken in commit ac0eb93.
Also fixing the o.y.pg.PgRegrFeature test.

Test Plan: Jenkins: rebase: 2.2

Reviewers: jason, mihnea

Reviewed By: mihnea

Subscribers: ena, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

3 participants