postgresqlwindows-server-2008

Can't access PostgreSQL from outside of the server


Can't access PostgreSQL from outside of the server

I already have 2 instances of PostgreSQL database on my server, but they were configured not by me. Both databases are lunched as service on Windows Server. There is a column 'Log On As' where values for PostgreSQL services are 'Network Service'.

I created another instance of PostgreSQL and added it to the service via pg_ctl.exe. Everything is exactly the same as other services have. One different is that value for 'Log On As' is set to '.\postgres'. If I change it to 'Network Service', then I recieve the next message in service startup:

The "servicename" service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

If it set to '.\postgres' or 'Local System' then database can be lunched and I can access it via pgAdmin (if it is on local server). But I can't access this database from outside of the server.

In postgresql.conf I only set listen_addresses and port.

The problem might be in router, but I want to know that this 'Log On As' is not a root of the problem.


Solution

  • My problem when I can't start PostgreSQL service with 'Network Service' as 'Log On As' was caused by lack of permissions to data folder for this user. I just added 'Network Service' in the Security tab with Full control permissions and this solved this small problem.

    But the problems, when I can't access my database from outside of my server were caused by network settings. I configured my router and now everything works fine.