I followed the instructions as: https://ubuntu.com/server/docs/databases-postgresqlThis is what I did:
Postgresql-server (On my Ubuntu desktop computer)
# Installed the Postgresql server # Went to the sudo nano /etc/postgresql/14/main/pg_hba.conf # entered following line at end: # My understanding of below line is allow the connection to the # this ubuntu computer (10.1.2.3) from a # remote device with ip 10.1.2.4 with user postgreshostssl template1 postgres 10.1.2.4 scram-sha-256# This device ip on which Postgresql server is sitting: 10.1.2.3
Postgresql-client (On the remote Raspberry PI device) (ip: 10.1.2.4):This is what I did:
# Install Postgresql-client # access the Postgresql-server as psql --host 10.1.2.3 --username postgres --password --dbname template1
Present output on the Postgresql-client:
psql error: could not connect to server: connection refused Is the server running on host 10.1.2.3 and accepting TCP/IP connections on port 5432?
First time I heard about this port 5432. I would like to know what is wrong and how to rectify it?
Update: