Message-ID: From: "wufengke (@wufengke)" To: "pgjdbc/pgjdbc" Date: Sun, 13 Jul 2025 14:32:13 +0000 Subject: [pgjdbc/pgjdbc] issue #3726: BatchInsert + generatedKeys will cause insert block in DB List-Id: X-GitHub-Author-Id: 4140747 X-GitHub-Author-Login: wufengke X-GitHub-Issue: 3726 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/3726 Content-Type: text/plain; charset=utf-8 version: 42.7.4 When I use the executeBatch() for a bulk(infact it's small) data insert and want return the generatedKeys, I find when the batch size is more than 50, it will sometimes block in the DB and does not return any more. I can not find the root cause. This issue still exists in the newest version. The key point I think it related to the retrunGeneratedKeys, more keys returned and more chance it will happen. If it is a known issure, what is the best practise to workaround if I want to get the serial generated keys when insert data? Insert without result key and find them by a batch query after insert is a best way?