Subject: [pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default

From: "mipo256 (@mipo256)" <[email-masked]>
Date: Sun, 29 Jun 2025 14:17:55 +0000

In general, enabling the `reWriteBatchedInserts` comes with significant performance improvements over sending multiple `SimpleQuery` queries. 

I do not see any reason [to keep it disabled by default](https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/PGProperty.java#L591). 

Although, from the JDBC API user's point of view, this change does not seem to be breaking, the thing to keep in mind here is that the tooling in-between driver/backend (such as PgBouncer for instance) needs to be able to suport it. Best to my knowledge, PgBouncer does not have any limitation in here.

In any case, I'll leave this issue as a placeholder for the further discussion on this topic.

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Mon, 30 Jun 2025 06:48:06 +0000

>from the JDBC API user's point of view, this change does not seem to be breaking

The setting changes the behaviour of `java.sql.Statement#executeBatch`. The method should return then number of modified rows for every batched statement: `int[]`.

If the driver goes with `reWriteBatchedInserts=true`, then it can no longer tell the number of modified rows for every `addBatch` statement, so the driver has to result to `Statement.SUCCESS_NO_INFO` value.

That is why we can't flip the default.