-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Postgres Max Identifier length is 63 bytes #6098
Comments
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Not stale. I don't think that a playground PR is strictly necessary here. Links to the documentation and current tested expectations have been mentioned. |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Insistent little bot... |
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the |
Since different databases support different lengths, we can add configuration items to |
Hii !! |
@a631807682 You asked to add configuration item in
Since i have added IdentifierLength field in NamingStrategy so i had impression we would use schema.NamingStrategy to populate Identifier Length, like this
You said its not recommended to do it on the basis of dialector name. ok got it !! 👍🏻 Now my question is: how can we pass identifier length to Apply according to choosen dialector ?? (because apparently driver implementing interface dialector is passed, and we need to pass Identifeir Lengths to NamingStrategy according to DB) How we know we need to initialize identifierMaxLength as 63,64 or 128 if we don't kknow the DB.
I know you are busy, but your little help will push me to complete this task, Thanks 😄 |
We just need to set a default value, and then override it through Apply api in each driver |
@a631807682 Does it make sense to close the issue? since it was addressed in the #6337 |
GORM Playground Link
(no playground link)
Description
Postgres has a max identifier length of 63 bytes. I see a test here that's asserting for 64 characters/bytes.
https://github.com/go-gorm/gorm/blob/master/schema/naming_test.go#L196
https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes
https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
The text was updated successfully, but these errors were encountered: