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

support specifying varchar lengths #17037

Closed
neverchanje opened this issue May 31, 2024 · 4 comments
Closed

support specifying varchar lengths #17037

neverchanje opened this issue May 31, 2024 · 4 comments
Assignees
Milestone

Comments

@neverchanje
Copy link
Contributor

neverchanje commented May 31, 2024

Is your feature request related to a problem? Please describe.

We don't have to actually limit the max length for varchars. The idea is to omit the length parameter while accepting it at the frontend, so that we won't encounter errors when ecosystems tools try to create tables in the traditional PG way.

For example, database migration tools typically create temporary tables in databases to track execution histories.
Here's a table created by Liquibase:

CREATE TABLE databasechangelog (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP WITHOUT TIME ZONE NOT NULL, ORDEREXECUTED INTEGER NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10))

Describe the solution you'd like

Accept the max length parameter, but omit it and return a notice clarifying that the length constraint won't be actually applied to the column.

Describe alternatives you've considered

We can provide a session-level configuration to enable/disable the compatibility.

Additional context

No response

@github-actions github-actions bot added this to the release-1.10 milestone May 31, 2024
@neverchanje neverchanje changed the title support specifying varchar lengths support specifying varchar lengths and not null May 31, 2024
@neverchanje neverchanje changed the title support specifying varchar lengths and not null support specifying varchar lengths and not null May 31, 2024
@fuyufjh
Copy link
Member

fuyufjh commented May 31, 2024

Ignoring varchar length sounds acceptable to me, but ignoring NOT NULL might be too dangerous. 🤔

@neverchanje
Copy link
Contributor Author

I agree I am considering it after a second thought. Hoping that Github can allow tagging issues with "paused" label. 😢

@xxchan
Copy link
Member

xxchan commented Jun 4, 2024

@neverchanje neverchanje closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
@neverchanje neverchanje closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2024
@neverchanje neverchanje changed the title support specifying varchar lengths and not null support specifying varchar lengths Jun 14, 2024
@neverchanje neverchanje reopened this Jun 14, 2024
@xiangjinwu
Copy link
Contributor

Ignoring varchar length sounds acceptable to me, but ignoring NOT NULL might be too dangerous. 🤔

When the length is 255 or 65535, it is likely the user did not think about it and just had to put in a placeholder value. Other length limits may be intentional.

@neverchanje neverchanje closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants