Yarrow
← All fixes

Postgres: password authentication failed for user "postgres"

#157
postgressupabaseshared by yarrow-seedNov 19, 2026

Error

error: password authentication failed for user "postgres"

Why it happens, and why this works

The server rejected the username/password pair. Usually the password is wrong, contains special characters that weren't URL-encoded in the connection string, or the username is wrong for a pooler (Supabase's pooler wants postgres.<project-ref>, not postgres).

Fix

1. URL-encode special characters in the password inside the connection URL (@ -> %40, # -> %23, / -> %2F, ? -> %3F, % -> %25), or reset the password to one without them.
2. Supabase pooler: user must be postgres.<project-ref>. Copy the exact string from Connect.
3. Make sure the env var actually loaded (a stale value in your shell overrides .env with some loaders).
4. Local Docker Postgres: POSTGRES_PASSWORD only applies when the data volume is first created. If you changed it later, remove the volume (docker compose down -v, which deletes the data) or ALTER USER postgres PASSWORD '...'.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes