Skip to content

Instantly share code, notes, and snippets.

@lfittl
Last active May 10, 2024 06:30
Show Gist options
  • Save lfittl/1b0671ac07b33521ea35fcd22b0120f5 to your computer and use it in GitHub Desktop.
Save lfittl/1b0671ac07b33521ea35fcd22b0120f5 to your computer and use it in GitHub Desktop.
Enabling pg_stat_statements in a Docker container
version: '2'
services:
db:
image: postgres:16
ports:
- "5432:5432"
command: >
postgres
-c shared_preload_libraries='pg_stat_statements'
volumes:
- /var/lib/postgresql/data
environment:
POSTGRES_USER: myproject
@shanmugarajkamaraj
Copy link

For me, adding the commands of pg_stat_statements in docker-compose.yml is not worked
I added manually in the postgresql.conf inside the docker container worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment