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 configuration parameter extra_float_digits #3406

Closed
lmatz opened this issue Jun 22, 2022 · 3 comments
Closed

Support configuration parameter extra_float_digits #3406

lmatz opened this issue Jun 22, 2022 · 3 comments
Assignees
Labels
type/bug Something isn't working

Comments

@lmatz
Copy link
Contributor

lmatz commented Jun 22, 2022

Describe the bug

SET extra_float_digits = 3;
unrecognized configuration parameter "extra_float_digits"

To Reproduce

Expected behavior
The same as PG.

Additional context

@lmatz lmatz added the type/bug Something isn't working label Jun 22, 2022
@lmatz lmatz self-assigned this Jun 22, 2022
@lmatz
Copy link
Contributor Author

lmatz commented Jun 23, 2022

postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT

For compatibility with output generated by older versions of PostgreSQL, and to allow the output precision to be reduced, the extra_float_digits parameter can be used to select rounded decimal output instead. Setting a value of 0 restores the previous default of rounding the value to 6 (for float4) or 15 (for float8) significant decimal digits. Setting a negative value reduces the number of digits further; for example -2 would round output to 4 or 13 digits respectively.

Any value of extra_float_digits greater than 0 selects the shortest-precise format.

Applications that wanted precise values have historically had to set extra_float_digits to 3 to obtain them. For maximum compatibility between versions, they should continue to do so.

@lmatz
Copy link
Contributor Author

lmatz commented Jun 23, 2022

My understanding is that setting to 3 for us is a no-op right now as we always output the shortest-precise format.

@liurenjie1024
Copy link
Contributor

Should we close this issue now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants