Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

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



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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group