4

I have a clean install of Windows 10 Pro x64 and I’m trying to run PostgreSQL server on it. It used to work perfectly on Windows 7, but Windows 10 is behaving really weird: If I configure PostgreSQL to listen on 127.0.0.1 then I can't connect to it using psql:

psql: could not connect to server: Permission denied (0x0000271D/10013)
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?

But if I change it to listen on 192.168.0.108 (my intranet ip) then everything works:

>psql.exe --host=192.168.0.108 --username=test test
psql (9.4.0)

Same behavior (meaning PostgreSQL works fine) is if I tell it to listen to localhost as a name instead of IP, although in both cases (either localhost or 127.0.0.1) it listens exactly on the same IP and port:

>netstat -abno | grep 5432 -A 1
  TCP    127.0.0.1:5432         0.0.0.0:0              LISTENING       3480
 [postgres.exe]
--
  TCP    [::1]:5432             [::]:0                 LISTENING       3480
 [postgres.exe]

There’s nothing in my C:\Windows\System32\drivers\etc\hosts. And I don’t think the problem is specific to PostgreSQL, I just used it as an example. I have other services running locally which have the same problem - can’t connect to local socket because of permissions error.

4
  • and to confirm, you are accessing the port from the same box its hosted on, correct? One thing to look at is the localhost binding. Many are not aware that any address in the 127. block can work as loopback, but not all of them are bound to the name localhost. Bonjour/AVAHI and other Zero-conf services can map other loopback addresses to names like mybox.local. It is also possible that IPv6 is muddying the waters, so consider disabling it if it is unneeded. Aug 25, 2015 at 11:44
  • Yes, I access it from the same box. IPv6 was also my suspect, so I've tried disabling IPv6 through registry (Services/TSCPIP6/Parameters, DisabledComponents key) and through network adapter settings, but it doesn't help.
    – extesy
    Aug 25, 2015 at 17:05
  • Do you have a firewall running? try disabling it temporarilly and see if that impacts the situation. otherwise everything you have shown checks out fine. Aug 25, 2015 at 18:44
  • I have KIS2016 running. Tried fully disabling it for a few minutes. Doesn't help either.
    – extesy
    Aug 25, 2015 at 23:26

0

You must log in to answer this question.

Browse other questions tagged .