When authentication failure occurs, PostgreSQL will usually do its best to provide a useful error message, rather
than blindly fail. The following are common error messages you may encounter, with explanations:
FATAL 1: user "testuser" does not exist
The specified username was not found in the pg_shadow system table, meaning the user
does not exist. See Chapter 10 for more on adding users.
FATAL 1: Database "testdb" does not exist in the system catalog
This database cannot be found because it does not exist. Note that if you do not specify a database name to a
PostgreSQL connection, it will attempt to connect to the provided username.
No pg_hba.conf entry for host 220.127.116.11, user testuser, database testdb
You have succeeded in contacting the server, but the server is not accepting your
connection. The server refused the connection because it cannot find an entry for
testuser using testdb at their IP address (18.104.22.168)
Password authentication failed for user 'testuser'
You have succeeded in contacting the server and it is replying back, but the connection
failed password authorization. Check the password you are supplying to the server,
and make sure that it is correct. Further, you can check the Kerberos or Ident software
programs if you are using them for your password authentication.
You may want to check if this user has a password. If this user does not have one, and the
file is set to check for passwords, it will still check every user for their
password. For all users without a defined password, a NULL password is assigned to
that user. When the user tries to log in and does not specify a password, it will compare the
NULL password to the NULL input, and it will return
On the other hand, if the user tries to supply a password (even a blank one), it will compare that input value
with the NULL password and still return false. If you are using
password authentication, you must assign a password to all users. If a password is not assigned to a user in
such a scheme, password authentication will always fail, and the user will not be able to log in.