Skip to content

Troubles connecting via pgBouncer #4489

Answered by nscuro
pinkfloydx33 asked this question in Q&A
Discussion options

You must be logged in to vote

I think you need to configure PgBouncer with pool_mode=transaction. You'll also want to ensure that you're running a PgBouncer version newer than 1.21.0, and that you configured max-prepared-statement value.

The following Docker Compose snippet works for me:

services:
  apiserver:
    depends_on:
    - postgres
    environment:
      ALPINE_DATABASE_MODE: "external"
      ALPINE_DATABASE_URL: "jdbc:postgresql://pgbouncer:6432/dtrack"
      ALPINE_DATABASE_DRIVER: "org.postgresql.Driver"
      ALPINE_DATABASE_USERNAME: "dtrack"
      ALPINE_DATABASE_PASSWORD: "dtrack"
      ALPINE_DATABASE_POOL_ENABLED: "false"

  postgres:
    image: postgres:17-alpine
    environment:
      POSTGRES_DB: "d…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@pinkfloydx33
Comment options

@nscuro
Comment options

@nscuro
Comment options

@pinkfloydx33
Comment options

Answer selected by pinkfloydx33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants