Re: Configure foreign host for PostgreSQL 8.0.3 on WindowsXP

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Todd Rockhold" <toduro(at)gmail(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Configure foreign host for PostgreSQL 8.0.3 on WindowsXP
Date: 2005-09-28 08:14:11
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE6C7A0C@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> Installed PostgreSQL 8.0.3 on WindowsXP. Have not been able
> to configure so that a client program running on a different
> WindowsXP box can connect to the PostgreSQL database.
>
> As I understand the documentation, at least one of the
> following configurations should work, but none do. What have
> I done wrong and how can I configure so that a connection can
> be successfully made?
>
>
> 1) The postgresql.conf file has (with everything else being
> the installation default values):
>
> listen_addresses = '*'
>
> 2) None of the following configurations of the pg_hba.conf
> file worked (the program runs on 192.168.2.120):
>
> # IPv4 local connections:
> #host all all 127.0.0.1/32 md5
> host all all 192.168.2.120/24 md5
>
> # IPv4 local connections:
> #host all all 127.0.0.1/32 md5
> host all all 192.168.2.120
> 255.255.255.255 md5
>
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> host all all 192.168.2.120/24 md5
>
> # IPv4 local connections:
> host all all 127.0.0.1/32 md5
> host all all 192.168.2.120
> 255.255.255.255 md5
>
> I have a Symantec personal firewall installed which I turned
> off during testing.
>
> The program runs fine on localhost.
>
> Am using the Npgsql .NET library. The Npgsql.Npgsql.Open()
> call throws an exception, the error text of which is
> "System.Net.Sockets.SocketException: NO connection could be
> made because the target machine actively refused it."

Check:
1) the listen_address='*' didn't "take". Make sure you remembered to
remove the comment sign (yup, i've seen that mistake manu times). Also,
you need to restart the service after you've changed that, perhaps you
forgot it?
2) Is there any chance that the postmaster is running on a non-default
port? Or that the client is connecting on a non-standard port?
3) Verify that the IP Npgsql connects to is correct. If you're using a
DNS name, make sure it resolves right.

If all those look right, run a "netstat -na" on the commandline and see
if there is a listener to port 5432 and what IP that one is bound to.

//Magnus

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message bramhe manoj 2005-09-28 10:24:45 database access queries
Previous Message Todd Rockhold 2005-09-28 07:33:14 Configure foreign host for PostgreSQL 8.0.3 on WindowsXP