Postgres by default does not allow all network clients access to the databases by simply providing a username and password. The clients must be "registered" via the pg_hba.conf file. See for details. After changes are made to pg_hba.conf the server must be signaled to reload the configuration files using pg_ctl reload