-
Notifications
You must be signed in to change notification settings - Fork 913
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
Pooler Error: Unsupported startup parameter: extra_float_digits #475
Comments
@tsachih I believe this can be solved by implementing a custom dialer: #470 (comment) |
Yes, implementing a custom dialer would provide a possible solution for this issue.However, note that the problem is more parameters setting related rather then dialing related. @tsachih I believe this can be solved by implementing a custom dialer: #470 (comment) — |
Just ran into this myself. Is there a reason sql.Open("host=hostname port=5432 sslmode=disable extra_float_digits=3") Problem is, even though I can set it back to its default value, I can't remove it entirely. What in the driver requires it? |
Getting out correct values for floats from the database. You'll see that other drivers (such as the JDBC one) send the same setting over, so it's not like pq is doing anything out of the ordinary here. I don't think this is really worth changing. |
I see this has been discussed before (#205) so I won't belabor the point. I'm just surprised the driver needs to hard code this when it's trivial to configure in at least two other places, the DSN and postgresl.conf. Also, I'm guessing what pgJDBC is doing isn't entirely usual as I don't have this problem in PHP and I can't find a reference to But I'll go ahead and use |
Is the DSN string is a known standard ? i.e. can we set it with some custom instrumentation values so that the dialer doesn't add that string ? The last one is the most versatile. Note that for my application, I cannot use ignore_startup_parameters since that particular pgbouncer is used by other clients. I don't want to modify the behavior of these clients. Note that the default value for extra_float_digits is zero. (https://www.postgresql.org/docs/9.0/static/datatype-numeric.html#DATATYPE-FLOAT) |
Another option which I didn't include above is to pass Since the extra_float_digits is a positive integer number, we can use this value to indicate that we want to use the default value. |
@tsachih |
Just ran into this problem as well. +1 for making this behaviour optional. |
from https://github.com/pgbouncer/pgbouncer/blob/master/NEWS.rst
just enable
|
[^1]: lib/pq#475 lib/pq sends extra_float_digits as a startup parameter [^1] whenever initialising a Postgres connection. PgBouncer doesn't recognise this parameter and will fail whenever you send it. To prevent this, we ensured pgsql-cluster-manager would ban PgBouncer configuration that didn't explicitly ignore this parameter. This is likely irrelevant after we moved to pgx though, so we should remove this constraint.
This is a workaround for lib/pq#475 which happens when using the PostgreSQL JDBC connector.
8 years later: no, changing the server configuration you have no authority over is not the right place to "fix" a client decision to disregard the server's choice. https://www.postgresql.org/docs/8.4/datatype-numeric.html#DATATYPE-FLOAT extra_float_digits has been formally introduced in 8.4 to increase the precision sent from the server to the client ; since 11, it's here to decrease that precision. In no way a client should have a hard coded confing trying to guess the application need regarding a lossy datatype, especially when it creates a bug with the widespread PgBouncer. |
When using the pq library along with pgbouncer, the following error is generated:
Pooler Error: Unsupported startup parameter: extra_float_digits
As a workaround, one could follow the instructions in Athou/commafeed#559
However, better control over the sent configuration would be a better approach.
i.e. existing library is hard-coding the following :
o.Set("extra_float_digits", "2")
which is the suspected cause for the issue.
The text was updated successfully, but these errors were encountered: