Postgres – Network Access

After installing postgres, there is no problem to access locally, however when you access through network , this error message occurs.

could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “10.100.206.84″ and accepting TCP/IP connections on port 5432?

This occurs because Postgres is not allowed to access in network in it’s configuration file.

You may fix this by doing these steps:
1) Go to Postgres intstallation directory’s data folder.

eg. C:\Program Files\PostgreSQL\9.0\data

2) Open the file pg_hba.conf in text editor like Notepad.

3) You will find the following line in the end of the file.
# IPv4 local connections:
host             all                  all                127.0.0.1/32           md5
# IPv6 local connections:
host            all                   all                 ::1/128 md5

add the following line under IPv4 local connections:

host             all                  all                10.100.206.84/32           md5

4) Save the file.

5) Restart Postgres services.

6) It’s Done.

Enjoy…!!