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

extra_float_digits URL support #2708

Closed

Conversation

brianheineman
Copy link
Contributor

When attempting to use SQLx 0.7.1 with Redshift, an error is returned upon connection due to extra_float_digits defaulting to 3. Adding the capability to define this value via a URL parameter removes the need for code changes or work-arounds (e.g. #801).

Connection Error: error returned from database: 3 is outside the valid range for parameter "extra_float_digits" (-15 .. 2)

@abonander
Copy link
Collaborator

Honestly, I'd rather just lower the default to 2. From Postgres 12 onward, any positive value selects the shortest-precise format so it doesn't really matter what we pass: https://www.postgresql.org/docs/12/runtime-config-client.html#GUC-EXTRA-FLOAT-DIGITS

The last Postgres release to actually care about the exact value will sunset in less than two months, and this behavior only ever affected the text-format output of floats anyway.

Otherwise my opinion is the same as #2135: it doesn't belong in the URL.

If you'd like to open a PR for changing the default, feel free.

@brianheineman
Copy link
Contributor Author

Thanks @abonander, I believe that is a much better solution as it will not require configuration when used with Redshift. I opened #2832 per your recommendation.

@brianheineman brianheineman deleted the extra_float_digits_url branch October 29, 2023 19:44
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