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

Proposed ALTER COLUMN varchar TYPE enum missing USING #3157

Open
rogersheu opened this issue Sep 26, 2024 · 0 comments
Open

Proposed ALTER COLUMN varchar TYPE enum missing USING #3157

rogersheu opened this issue Sep 26, 2024 · 0 comments

Comments

@rogersheu
Copy link

rogersheu commented Sep 26, 2024

I was recently running a quick change to create an enum and change the type of an existing column in a table (with matching values) to that enum.

The attempted change was ALTER TABLE foo_table ALTER COLUMN bar_column TYPE baz_enum;
I was getting an error where the column FOO cannot be cast automatically to type ENUM_NAME

However, from a quick search, it might need the following to apply correctly.
ALTER TABLE foo_table ALTER COLUMN bar_column TYPE baz_enum USING bar_column::baz_enum;

I think this is a similar issue to #3130, but not 100% exactly the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant