pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #4014: fix: restore pre-describe for generated-key batches
Date: Sun, 19 Apr 2026 08:13:25 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
I made the needed changes, notably:
1) The initial revert of d232e605de960f3a8ca2dfef4974dbe546b860bb did not account for `statement.closeOnCompletion()` (it was a long-standing bug), so I added `DiscardResultHandler` to avoid creating unwanted resultsets
2) The test used `text` column, and there was no way to estimate the max number of bytes returned. I switched to `varchar(N)` in tests, and added `varchar` estimator (it was not really working previously), see `estimateMaxLength`
3) Previously `flushIfDeadlockRisk` could issue `sync` even before the first query which apparently makes no sense. In my tests the logic works as expected, and it attempts to keep receiving buffer under 64000.
For the reference,
1) I've checked `getReceiveBufferSize()` and it easily grows to 400KiB, no matter if I configure it explicitly or not
2) I've tested different combinations for `MAX_BUFFERED_RECV_BYTES` and `receiveBufferSize`, and the current 64000 is still the sweet spot for my machine (Apple M1, PostgreSQL in Docker)
---
I will let the dust to settle, and it would be great if somebody else could review it as well.
view thread (24+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] PR #4014: fix: restore pre-describe for generated-key batches
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox