While I try to connect to Postgres through PGAdmin I get the following error:

Error connecting to the server: 
FATAL:  Peer authentication failed for user "postgres"

You're trying to use peer authentication (the default for unix sockets) from a user other than the user identity you are connecting as.

You could:

  • Create a user with the same name as your unix user and connect as that;
  • Change the authentication mode in pg_hba.conf;
  • ALTER USER postgres PASSWORD 'blah' then connect over TCP/IP with md5 password authentication by filling in the hostname and password fields

For more information see the Ubuntu docs on their PostgreSQL install (I'm assuming you're using Ubuntu since you didn't say) and the PostgreSQL documentation on client authentication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.