← All fixes
Postgres: password authentication failed for user "postgres"
#157Error
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 yet0 worked0 didn't
Tried it yourself?
Related fixes
TS18048: 'user' is possibly 'undefined' (after .find or an optional value)
#88error TS18048: 'user' is possibly 'undefined'.
typescriptVerifiedNo reports yet
TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled
#91error TS1484: 'User' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.
typescriptviteVerifiedNo reports yet
Postgres function still callable by anon after REVOKE FROM anon
#1Supabase RPC behind a paywall still returns data to logged-out users even after REVOKE EXECUTE ... FROM anon.