From: https://opensource.com/article/17/10/set-postgres-database-your-raspberry-pi
'''
-
Edit the PostgreSQL config file /etc/postgresql/9.6/main/postgresql.conf to uncomment the listen_addresses line and change its value from localhost to *. Save and exit.
-
Edit the pg_hba config file /etc/postgresql/9.6/main/pg_hba.conf to change 127.0.0.1/32 to 0.0.0.0/0 for IPv4 and ::1/128 to ::/0 for IPv6. Save and exit.
-
Restart the PostgreSQL service: sudo service postgresql restart.
/etc/postgres/11/main
listen_addresses = '' #listen_addresses = 'localhost' # what IP address(es) to listen on; # comma-separated list of addresses; # defaults to 'localhost'; use '' for all # (change requires restart) port = 5432 # (change requires restart)
/etc/postgres/11/main
host all all 127.0.0.1/32 md5 host all all 192.168.0.1/24 md5 #All 192.169.x.x addresses.
Then restart postgres:
sudo service postgresql restart