Windows DatabaseebooksStatistical Information

LLE10215 : Howto connect to postgres from the network

Symptom:

You want to connect to your postgresql server but you do not get access to the system although the server is listening on port 5432.

Cause:

none

Solution:

In the case your server is listening to the default port and you do not get access, you will have to make changes to your pg_hba.conf file.

On debain you can find this file in a postgres dependent path. e.g.

/etc/postgresql/8.3/main/

For information about how to make postgres listen on your network card, which is not the default, you can search in the knowledge base on "Howto make shure postgres will listen on the network".

In your pg_hba.conf file you will find the following:

...
# "local" is for Unix domain socket connections only
local   all         all                               ident sameuser
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5
...


I you want to listen from a full class network 192.168.123.0 with subnet mask 255.255.255.0 you can add the following line:

host    all         all         192.168.123.0/24        trust

If you restart your postgres server, you will be able to connect from the network.

Restarting can be done with:

invoke-rc.d postgresql-8.3 restart

Disclaimer:

The information provided in this document is intended for your information only. Lubby makes no claims to the validity of this information. Use of this information is at own risk!
Copyright © 2004-2011 Lubby (V3.0.10 Aug 2011)
Sponsored by Keskon.
Statistical information by Google Analytics