Skip to content

PostgreSQL error 28P01: password authentication failed

PostgreSQL received the connection attempt but rejected password authentication for the supplied user.

password authentication failed for user "docs_user"
SQLSTATE: 28P01

The quoted user name comes from your connection.

The server could not authenticate the database account with the supplied credentials. An incorrect password, an unknown user, or the wrong server can produce this error. A network timeout is a different problem.

  • A saved password predates a password reset or credential rotation.
  • The user name belongs to a different server or endpoint.
  • The host or port reaches another PostgreSQL installation.
  • A local socket login uses different authentication rules from a TCP login.
  1. Edit the saved connection using connection basics.
  2. Compare Host, Port, Database, and User with the intended server.
  3. Enter the current database password.
  4. Click Test.
  5. Save the corrected connection after a successful test.

Use the check for your setup:

Setup Check
Local PostgreSQL A password-free Terminal socket login does not verify the TCP password.
Docker Match the published port and the credentials in the existing database volume.
Cloud Obtain fresh database credentials and use all fields from one direct or pooled connection choice.
Company server Ask the administrator to confirm the role and reset its password through your approved process.

For endpoint-specific credentials, see Supabase, Neon, or Heroku.

Keep password authentication enabled while correcting the account. Disabling it can permit unauthorized access.

The connection failure includes PostgreSQL’s authentication message. Use the server error to distinguish a rejected password from an unreachable host. If you need administrator help, provide the endpoint, database user, error code, and time through an approved channel; never include the password.