Authentication in PostgreSQL
Authentication answers the question, who is the user? PostgreSQL supports several authentication methods, including trust, ident, password, GSSAPI, SSPI, LDAP, PAM, and so on. To understand authentication, one needs to have the following information:
Authentication is controlled via a
pg_hba.conf
file, wherehba
stands for host-based authentication.It is good to know the default initial authentication settings shipped with PostgreSQL distribution.
The
pg_hba.conf
file is often located in the data directory, but it also can be specified in thepostgresql.conf
configuration file.When changing the authentication, one needs to send a
SIGHUP
signal, and this is done via several methods based on the PostgreSQL platform. Also note that the user who sends the signal should be a superuser or the postgres or a root system user on the Linux distribution; again, this depends on the platform.psql -U postgres -c "SELECT pg_reload_conf();" sudo service postgresql reload sudo...