-1

I keep getting remaining connection slots are reserved for non-replication superuser connections errors when I run postgres:latest in Docker with Docker Compose.

How can I increase the maximum connections Postgres allows with Docker-Compose?

Note: This is not about Postgres alone, but rather how to pass the values to the official Postgres image on Docker.

tyteen4a03
  • 1,812
  • 24
  • 45

1 Answers1

-1

You can change the configuration file used by your postgresql image: https://docs.docker.com/samples/library/postgres/#database-configuration

The parameter you want to change is: max_connections, you will find more information about it here : How to increase the max connections in postgres?

kletord
  • 146
  • 5
  • 1
    The documentation above refers to mounting a custom `postgresql.conf` file with the desired modified `max_connections` and `shared_buffers` value, or alternatively set them directly on the run line, e.g. `docker run -d --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword postgres -c shared_buffers=256MB -c max_connections=200` – wolfyuk Mar 09 '22 at 15:30