PostgreSQL Network Access – (Solution)
After we installed and configure PostgreSQL properly, it is no problem to access locally, however when we access through the network , we hit following error message.
could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host “10.0.0.6” and accepting TCP/IP connections on port 5432?
It is because PostgreSQL disable network access by default. It is required to do some configuration to make it work.
1) Please access postgresql.conf file.
2) Modified it and uncomment listen_addresses field and put ‘*’ to indicate allow access from all network address.
3) Please access pg_hba.conf and put this line , 10.0.0.0 is my network, please change it accordingly
Please access PostgreSQL documentation to understand what inside pg_hba.conf and how to configure it
http://www.postgresql.org/docs/8.2/interactive/auth-pg-hba-conf.html
After all done, PostgreSQL is ready to access through network, actually i find out this feature is very useful, because it can restrict network access from specified ip address or network.