Re: trying to connect to pg from within a local network

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Albretch Mueller *EXTERN*" <lbrtchx(at)gmail(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: trying to connect to pg from within a local network
Date: 2008-01-16 16:00:38
Message-ID: D960CB61B694CF459DCFB4B0128514C2CC22D3@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Albretch Mueller wrote:
> I need to connect to a pg Windows installation that I have within the
> same network
> ~
> as listen_address I have listed: localhost, 127.0.0.1,
> 10.0.31.5, 10.0.31.62
> ~
> 10.0.31.5 is this "localhost" in the 10.0.31.* local network and
> 10.0.31.62 is me
> ~
> I have check all I can think of and it still does not work. Why can't
> I connect to pg from within the local network?
> ~
> Thanks
> lbrtchx
> ~
> C:\cmllpz\prjx\java\JDBC\PG>java PG00Test
> // __ aDrvr: |org.postgresql.Driver|
> // __ aDBURL: |jdbc:postgresql://10.0.31.5:5432/postgres|
> // __ Class.forName(org.postgresql.Driver): |class org.postgresql.Driver|
> // __ (Driver)KDrvr.newInstance() :|org(dot)postgresql(dot)Driver(at)1893efe|
> // __ DriverManager.registerDriver(OKDrvr);
> org.postgresql.util.PSQLException: Connection refused. Check that the
> hostname and port are correct and that the postmaster is accepting
> TCP/IP connections.
> at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:122)

You should have the following in postgresql.conf:

listen_addresses = '127.0.0.1,10.0.31.5'

Maybe the last entry you added is the problem.

Allowing certain client IP addresses is done in pg_hba.conf.

If that is NOT the problem:

Try the following on the client:

telnet 10.0.31.5 5432

and tell us the response.

Try the following on the server:

netstat -a

and tell us what you get.

Is there a firewall involved?

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mischa Sandberg 2008-01-16 16:41:42 postgresql in FreeBSD jails: proposal
Previous Message Tom Lane 2008-01-16 15:01:58 Re: Patch for Statement.getGeneratedKeys()