When authentication failures and related problems occur, similar messages like the following examples will appear. Here are some common error messages that you may encounter and their explanations:

FATAL 1: user "testuser" does not exist

The specified user name was not found in the pg_shadow table. You can create this user using the CREATE USER sequel command. The user will then automatically be added to the pg_shadow table.

FATAL 1: Database "testdb" does not exist in the system catalog

This database cannot be found because it does not exist. If you don't specify a database name, it will default to the username. This might not be the database you want to connect with. The best way is to specify the exact database name. Refer to the pg_hba.conf file for more information on how to specify that a user should connect to a certain database.

No pg_hba.conf entry for host, 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 this testuser at the the IP address in the pg_hba.conf file.

Password authentication failed for user 'testuser'

You have succeeded in contacting the server and it is replying back, but you failed the password authorization. Check the password you are supplying to the server and make sure it is correct. Also, you can check the Kerberos or IDENT software programs if you are using them for password authentication.

You can check to see if this user even has a password. If this user does not have a password, and the pg_hba.conf 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 a FALSE.

On the other hand, if the user tries to supply a password, it will compare that input value with the NULL password and return a FALSE. Therefore, if you are using password authentication, you must assign a password to all users. If a password is not assigned to users, then password authentication will always fail for those users and they will not be able to log in.

Help us make a better book, leave feedback. (http://www.opendocspublishing.com/entry.lxp?lxpe=92)