Skip to content

Support for pgBouncer transaction pooling mode #1144

@doppelrittberger

Description

@doppelrittberger

Version

4.2.4

Context

I use pgBouncer and postgres in my project and now I´m facing issues when using transaction pooling mode in pgBouncer (https://www.pgbouncer.org/features.html). It seems that PreparedQueries are not supported (as described at the pgBouncer documentation) but most JDBC libraries still support PreparedQueries using binary parameters mode (like JDBI, explanation is here: https://blog.bullgare.com/2019/06/pgbouncer-and-prepared-statements/). Is there any way to configure Vertx SQL Client to also use the same approach? The transaction pooling mode is the default and performance-wise the best mode and other libraries support this use case as well. Since quarkus uses Vertx SQL Client as default JDBC library it would be nice if this would be supported as well :)

Do you have a reproducer?

I created a test project at github to showcase the behavior. I used quarkus to simplify the project but use mainly the vertx methods.
Please use the included infra-pgbouncer.yml docker compose file to create a postgres/pgbouncer instance. Then run the Start.main() and see the issues.
I included a comparison to JDBI which works with pgbouncer using the same queries in transaction pooling mode.

Steps to reproduce

  1. checkout the repoducer
  2. use docker-compose to setup a pgbouncer instance (docker-compose -f infra-pgbouncer up -d)
  3. run the Start.main() -> Vertx code will fail with "ERROR: unnamed prepared statement does not exist (26000)", JDBI will work correctly

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions