Skip to content

Add varchar limit detection as per PostgreSQL limits #302

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

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

keif888
Copy link
Contributor

@keif888 keif888 commented Feb 18, 2025

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Add handling for string length's that exceed 10485760 so that PostgreSQL won't complain about the field length.
Add tests to confirm change.

User Case Description

Enable PostgreSQL to store text fields that exceed 10485760 in length, which is the maximum length of a varchar as per https://www.postgresql.org/docs/current/datatype-character.html.
This is similar to MySQL and SQLServer where specific lengths trigger a difference in the used data type.

@jinzhu jinzhu merged commit 9723eac into go-gorm:master Mar 10, 2025
1 check passed
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.

2 participants