pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
[pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default
2+ messages / 2 participants
[nested] [flat]

* [pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default
@ 2025-06-29 14:17 "mipo256 (@mipo256)" <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: mipo256 (@mipo256) @ 2025-06-29 14:17 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

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#L59...). 

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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default
@ 2025-06-30 06:48 "vlsi (@vlsi)" <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: vlsi (@vlsi) @ 2025-06-30 06:48 UTC (permalink / raw)
  To: pgjdbc/pgjdbc <[email protected]>

>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.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-06-30 06:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-06-29 14:17 [pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default "mipo256 (@mipo256)" <[email protected]>
2025-06-30 06:48 Re: [pgjdbc/pgjdbc] issue #3694: Enable reWriteBatchedInserts by default "vlsi (@vlsi)" <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox