Postgres: missing or invalid pg_hba.conf file

I have 2 machines that are sitting on my desk and are connected to the same IP network. I am trying to connect an application from one computer to a postgres database, from another. First, the host with the application on it gave me a PSQLException:

FATAL: no pg_hba.conf entry for host "192.168.1.18", user "user1", database "test", SSL off 

So, I edited the pg_hba.conf file to accept the IP address: 192.168.1.18, adding the line below at the end of the file:

 host pnp all 192.168.1.18 trust 

Then I got another error message:

 FATAL: missing or erroneous pg_hba.conf file 

Is there anything that I am missing here?

Thank you Lancelot

+7
postgresql configuration
source share
1 answer

You must also specify the host netmask. Therefore, either " 192.168.1.18/32 " or " 192.168.1.18 255.255.255.255 " instead of a bare IP address.

See the pg_hba.conf chapter in the online manual for more details.

+13
source share

All Articles