Subject: [pgjdbc/pgjdbc] issue #3490: Clarify startup parameter selection since Version 12 for extra_float_digits

From: "ecki (@ecki)" <[email-masked]>
Date: Wed, 22 Jan 2025 00:52:43 +0000

This code sends extra_float_digits=2 for older than 9 and newer than 12. 

https://github.com/pgjdbc/pgjdbc/blob/032d0e225a91e866d7dae680ebb784507392e803/pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java#L918

It probably doesnt matter for newer Servers if 2 or 3, but the comment in the code does not explain this case.

Either remove the <12 condition so it sends 3 for all neuer Servers or explain in the else „also send value 2 for newer servers (since 12 any value bigger than 0 will enable the shortest precise decimal mode).“

I would and a comment clarifying the meaning of 3 for older servers and >0 for newer ones anyway as there to explain the hardcoded values 2 and 3.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 22 Jan 2025 01:23:08 +0000

Good catch, thanks!

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 22 Jan 2025 07:07:24 +0000

fixed in PR #3491

---

From: "ecki (@ecki)" <[email-masked]>
Date: Sun, 02 Feb 2025 19:07:13 +0000

Thanks