Ketika melakukan koneksi dari aplikasi kemudian mendapatkan error ini:
org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "postgres"
Ini karena terjadi kegagalan otentikasi di postgresqlnya. Dari error messagenya kemungkinan konfigurasi autentikasi postgresql masih default. Ini terlihat dari kata kunci “ident”.
Salah satu solusinya adalah mengubah konfigurasi ini di dalam file /var/lib/pgsql/data/pg_hba.conf.
Ini salah satu contoh hasil pengubahan konfigurasi ini:
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
host kantordb postgres 0.0.0.0/0 trust
host penjualandb postgres 0.0.0.0/0 password
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
# "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
# "password" sends passwords in clear text; "md5" is preferred since
# it sends encrypted passwords.
Kemudian restart service postgresql agar perubahan ini diterapkan.