Re: Connect to Postgres problems

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: Connect to Postgres problems
Дата
Msg-id 4B679945.2010901@2ndquadrant.com
обсуждение исходный текст
Ответ на Connect to Postgres problems  (Christine Penner <christine@ingenioussoftware.com>)
Список 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 по дате отправления:

Предыдущее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: reducing result set of tsvector @@ tsquery avoiding to use ts_rank
Следующее
От: Yan Cheng Cheok
Дата:
Сообщение: Use Trigger to Remove Table itself when there is no row after delete