Skip to content

Don't send extra_float_digits for PostgreSQL 12+ by default #3432

@NKame

Description

@NKame

Describe the issue
Connecting through PgBouncer with a default configuration fails.

Driver Version?
All supported.

Java Version?
All supported.

OS Version?
All supported.

PostgreSQL Version?

= 12

To Reproduce
Connect throught PgBouncer. Fails with unsupported extra_float_digits parameter.

Expected behaviour
Connected to the database.

Context
extra_float_digits has been introduced in PostgreSQL 8.4 to play around the apparent precision of the lossy datatype "float". At first to increase the precision sent to the client, then since version 12, to reduce it. In pgJDBC, if you want the "full" precision with a server 12+, you must override this parameter since it is forced in the driver to the value 3 if the server is 9+, that means you have to send it twice to the server. Furthermore, by default it's not authorized by default with PgBouncer: "the internet" answer is to change the server, whereas it doesn't make really sense to send it at all for PostgreSQL 12+. (And the question of forcing a default for the lossy datatype should be asked... in my view it should be an explicit choice from the application owner).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions