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

Throw error in alter table set default if default fails rule(s) #1275

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

druvv
Copy link
Contributor

@druvv druvv commented Sep 21, 2022

This PR makes alter column set default error when its default expression fails the default expression rules. Previously the DDL succeeded and when an insert or any other query was performed the default would cause a continuous error.

alter table t alter column col1 set default '{\"bye\":1}'
-- errors with: TEXT, BLOB, GEOMETRY, and JSON types may only have expression default values

@druvv druvv requested a review from fulghum September 21, 2022 23:42
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice fix! ✨

@druvv druvv merged commit 237d6d0 into main Sep 22, 2022
@Hydrocharged Hydrocharged deleted the dhruv/alter-default branch October 13, 2022 12:50
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

Successfully merging this pull request may close these issues.

None yet

2 participants