open port?

Posted on 2005-03-30
Medium Priority
Last Modified: 2012-06-27
I think I've got postgresql 8.0 working on my system. But, the port doesn't seem to be open.

If I do:
  telnet localhost 5432
then it connects.

If I change localhost to be the ip of the server then it says the connection is refused despite the fact that I'm running it from that server.

What do I need to do to make it visible so I can use pgAdmin on it from a different machine?
Question by:HappyEngineer
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 22

Assisted Solution

by:earth man2
earth man2 earned 2000 total points
ID: 13670122
You need to edit
Of course the login method you want to use wants to be a little more sophisticated than trust !
Set it to trust initially so you can get a connecttion then use a suitable METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all          trust
host    YOUR_DATABASE         YOUR_USER_ACCOUNT      trust

Author Comment

ID: 13676444
First I tried:
  host    all         postgres    192.168.NNN.1/24       md5
where NNN is the number I use on my home machine. I then did "pg_ctl reload" but I still couldn't connect with pgAdmin.

So then I tried:
  host    all         all         NNN.NN.NNN.NN/32      trust
where NNN.NN.NNN.NN is the ip address of the server. I then did "pg_ctl reload" and then tried telneting to it from the server and it still refuses the connection.
LVL 22

Expert Comment

by:earth man2
ID: 13676723
Well 192.168.NNN.1/24  WILL NOT WORK because it will not traverse the internet.  You need the ip address of your internet connection in there.

use 24 instead of 32
LVL 22

Accepted Solution

earth man2 earned 2000 total points
ID: 13676762
in $PGDATA/postgressql.conf specify what ip addresses you want to listen on.
listen_addresses = '*'
or more securely
listen_addresses = 'localhost,NNN.NN.NNN.NN'

pg_ctl restart

Author Comment

ID: 13677874
That did it! The only remaining issue is that my development machine has a dynamic IP. I guess I'll just have to change it every time my IP updates.

Perhaps there's a dynamic IP DNS system or something?

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question