I am trying to start the PostgreSQL database, but it's always failing.

Command I am trying: psql -h localhost -U postgres resulting error: psql: FATAL: Ident authentication failed for user "postgres".

Contents of /var/lib/pgsql/9.5/data/pg_hba.conf is as follows:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres            ident
#host    replication     postgres        ::1/128                 ident

I recently made the change for the pg_hba.conf file, I am assuming I don't have to restart the postgres. I followed this solution but no help. Any suggestion on how to fix this?

  • 1
    peer is the local version of ident. Both options expect that the user running the psql command is the same as the user you are trying to log in as.
    – DerfK
    Apr 18, 2017 at 21:21


Your Answer

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

Browse other questions tagged or ask your own question.