PostgreSQL comes in a variety of distributions. In many of these, you will find that remote access is initially disabled as a security measure.
listen_addresses = '*'
pg_hba.conf, to allow access to all databases for all users with an encrypted password:
# TYPE DATABASE USER CIDR-ADDRESS METHOD host all all 0.0.0.0/0 md5
listen_addresses parameter specifies on which IP addresses to listen. This allows you to have more than one network card (NICs) per system. In most cases, we want to accept connections on all NICs, so we use "*", meaning "all IP addresses".
pg_hba.conf contains ...