Re: Connect to Postgres problems - Mailing list pgsql-general

From Greg Smith
Subject Re: Connect to Postgres problems
Date
Msg-id 4B679945.2010901@2ndquadrant.com
Whole thread Raw
In response to Connect to Postgres problems  (Christine Penner <christine@ingenioussoftware.com>)
List pgsql-general
Christine Penner wrote:
> I'm having trouble getting a connection to Postgres to work from
> outside of my local network. It was working fine at one point. Then I
> had to change IP addresses and I can't get it to work. This is what
> I've done.
>
> On the computer with Postgres installed I have this in the pg_hba.conf
> file:
> host     all     all     207.6.93.152/32         md5

This will only allow the host at 207.6.93.152 to connect.  If you're
trying to reach the database from any other system, that won't work.

> I know the user name and password etc are correct because I can
> connect locally using the same stuff.  The only things that have
> changed since it was working is IP addresses. I confirmed they are
> right. Also when trying to get it working I noticed that the port
> forwarding got disabled somehow so I set that up again but still no luck.

Generally the troubleshooting works like this:

1) Confirm psql connects from the host (with the default, sockets based
connection)
2) Confirm psql connects using TCP/IP on that same host.  So "psql -h
<server ip>" on the server itself.  If that doesn't work, probably an
issue with listen_addresses or pg_hba.conf
3) Connect to the database from another host on the same local network.
If this fails, check pg_hba.conf again, and make sure the server's
firewall is configured to allow connections to the port
4) Connect from an outside network.  Now any problem you have should be
limited to just being related to things like port forwarding.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com   www.2ndQuadrant.us


pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: reducing result set of tsvector @@ tsquery avoiding to use ts_rank
Next
From: Yan Cheng Cheok
Date:
Subject: Use Trigger to Remove Table itself when there is no row after delete