You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a different username is passed using POSTGRES_USER the container will exit as the user doesn't exist:
docker run \
-e POSTGRES_PASSWORD=custom \
-e POSTGRES_USER=custom \
-e POSTGRES_DB=custom \
supabase/postgres
...
server started
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "custom"
[local] 2023-06-26 10:09:42.844 UTC [68] custom@postgres LOG: provided user name (custom) and authenticated user name (postgres) do not match
[local] 2023-06-26 10:09:42.844 UTC [68] custom@postgres FATAL: Peer authentication failed for user "custom"
[local] 2023-06-26 10:09:42.844 UTC [68] custom@postgres DETAIL: Connection matched pg_hba.conf line 83: "local all all peer"
Error: exit status 2
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Main difference that "causes" this is that the base image doesn't use peer authentication for local executed commands, but rather trusts anything that comes from the unix domain.
Possible fix would be to add something in the entrypoint that appends the postgres → $POSTGRES_USER mapping to pg_ident if $POSTGRES_USER != postgres. I'd gladly write this and do a PR but not sure if opinions differ on that approach.
Bug report
Describe the bug
When a different username is passed using
POSTGRES_USER
the container will exit as the user doesn't exist:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
docker run \ -e POSTGRES_PASSWORD=custom \ -e POSTGRES_USER=custom \ -e POSTGRES_DB=custom \ supabase/postgres
Expected behavior
Database & user are created with passed environment variables
Screenshots
NA
System information
NA
Additional context
NA
The text was updated successfully, but these errors were encountered: