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] ALTER table ALTER column #1200

Closed
ndeodhar opened this issue Apr 11, 2019 · 2 comments
Closed

[YSQL] ALTER table ALTER column #1200

ndeodhar opened this issue Apr 11, 2019 · 2 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
Milestone

Comments

@ndeodhar
Copy link
Contributor

ndeodhar commented Apr 11, 2019

Support variations of ALTER TABLE ALTER COLUMN like:

ALTER TABLE ALTER COLUMN SET/DROP NOT NULL
ALTER TABLE ALTER COLUMN SET/DROP default
ALTER TABLE ALTER COLUMN SET STORAGE (This should simply log a warning that storage params will be ignored, but the statement should succeed).

@ndeodhar ndeodhar added the area/ysql Yugabyte SQL (YSQL) label Apr 11, 2019
@ndeodhar ndeodhar added this to To do in YSQL via automation Apr 11, 2019
@ndeodhar ndeodhar added this to the v2.0 milestone Jul 12, 2019
@ndeodhar
Copy link
Contributor Author

This is needed by pg_dump, yugaware and graphql.

@ndeodhar ndeodhar changed the title [YSQL] ALTER table ALTER column DROP constraint [YSQL] ALTER table ALTER column Jul 16, 2019
@ndeodhar ndeodhar assigned rajukumaryb and unassigned jaki Jul 16, 2019
@georgeklees
Copy link
Contributor

An example of why pg_dump needs this is in #1793. When we have a table with a SERIAL key, the correct behavior (in vanilla Postgres, currently being fixed to occur in YugaByte also) is to make a table with an integer key, create a sequence for that key, and use ALTER TABLE ALTER COLUMN to make the default value of the integer key be the nextval() of that sequence.

rajukumaryb added a commit that referenced this issue Aug 15, 2019
Summary:
  Usage:
    ALTER TABLE ... ALTER COLUMN ... SET DEFAULT ...;
    ALTER TABLE ... ALTER COLUMN ... DROP DEFAULT;

Test Plan:
  ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressFeature

Reviewers: neha

Reviewed By: neha

Subscribers: bogdan, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D7073
rajukumaryb added a commit that referenced this issue Aug 20, 2019
Summary:
  Usage:
    ALTER TABLE ... ALTER COLUMN ... SET NOT NULL
    ALTER TABLE ... ALTER COLUMN ... DROP NOT NULL

Test Plan:
  ./yb_build.sh --java-test org.yb.pgsql.TestPgRegressFeature

Reviewers: neha

Reviewed By: neha

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D7080
@ndeodhar ndeodhar moved this from To do to In progress in YSQL Aug 21, 2019
@ndeodhar ndeodhar closed this as completed Oct 7, 2019
YSQL automation moved this from In progress to Done Oct 7, 2019
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
YSQL
  
Done
Development

No branches or pull requests

4 participants