An open-source object-relational database management system.

Install

Install on Fedora

Config

Config file can be found with:

sudo find / -iname "pg_hba.conf" -print

It’s default location should be /var/lib/pgsql/data/pg_hba.conf

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.

Example records forms:

local         DATABASE  USER  METHOD  [OPTIONS]
host          DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
hostssl       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
hostnossl     DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
hostgssenc    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
hostnogssenc  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]

First field is the connection type:

  • local - Unix-domain socket
  • host - TCP/IP socket (encrypted/not encrypted)
  • hostssl - TCP/IP socket that is SSL-encrypted
  • hostnossl - TCP/IP socket, not SSL encrypted
  • hostgssenc - TCP/IP socket, GSSAPI-encrypted
  • hostnogssenc - TCP/IP socket, not GSSAPI-encrypted

DATABASE can be:

  • all (does not match replication)
  • sameuser
  • samerole
  • replication
  • a database names
  • comma separated list of values above

USER can be:

  • all
  • user name
  • group name prefixed with +
  • comma separated list of values above

To include names from a separate file use @file_name prefix.

ADDRESS specifies the set of hosts the record matches. It can be:

  • host name
  • IP address in a CIDR notation

METHOD can be:

  • trust
  • reject
  • md5 - encrypted password
  • password - in clear text, non-preferable
  • scram-sha-256 - encrypted password
  • gss
  • sspi
  • ident
  • peer
  • pam
  • ldap
  • radius
  • cert

Database and user names with special symbols must be quoted.

Configuration is read of server startup and when SIGHUP signal received (pg_ctl reload, SELECT pg_reload_conf()).

Fix pgadmin ident authentication failed for user

https://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/