til

Today I Learned: collection of notes, tips and tricks and stuff I learn from day to day working with computers and technology as an open source contributor and product manager

View project on GitHub

Silence Warnings from PostgreSQL

If you observer a plethora of warnings in your PostgreSQL Docker setup like:

FATAL: role "root" does not exist

If these errors are emitted from the PostgreSQL healthcheck, they can be silenced by adding the user parameter to the health check command for pg_isready in your docker-compose.yml file.

healthcheck:
   test: ["CMD-SHELL", "pg_isready -U postgres"]
   interval: 30s
   timeout: 30s
   retries: 3

This works for official PostgreSQL Docker images, where a postgres user is created, adjust to your own settings accordingly

References

-GitHub issue describing the symptom -GitHub commit describing the remedy