Message-ID: From: "bilalshehata (@bilalshehata)" To: "pgjdbc/pgjdbc" Date: Thu, 09 Apr 2026 07:00:45 +0000 Subject: [pgjdbc/pgjdbc] PR #4014: fix: restore pre-describe for generated-key batches List-Id: X-GitHub-Author-Id: 30518704 X-GitHub-Author-Login: bilalshehata X-GitHub-Issue: 4014 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/4014 Content-Type: text/plain; charset=utf-8 Commit [d232e605](https://github.com/pgjdbc/pgjdbc/commit/d232e605de960f3a8ca2dfef4974dbe546b860bb) removed the pre-describe step from internalExecuteBatch for queries with wantsGeneratedKeysAlways. Without it the driver cannot estimate result row sizes before pipelining, so flushIfDeadlockRisk falls back to 250 bytes per query. For INSERT ... RETURNING with large columns the actual response is orders of magnitude larger, overflowing TCP buffers and causing client/server deadlock. ### All Submissions: * [x] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document? * [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change? ### New Feature Submissions: 1. [x] Does your submission pass tests? 2. [x] Does `./gradlew styleCheck` pass ? 3. [x] Have you added your new test classes to an existing test suite in alphabetical order? ### Changes to Existing Features: * [x] Does this break existing behaviour? If so please explain. * [x] Have you added an explanation of what your changes do and why you'd like us to include them? * [x] Have you written new tests for your core changes, as applicable? * [x] Have you successfully run tests with your changes locally?