RE: Remote Connection Help

From: "Jason L(dot) Amerson" <drjason(at)alphagenius(dot)org>
To: "'Steve Crawford'" <scrawford(at)pinpointresearch(dot)com>
Cc: "'Adrian Klaver'" <adrian(dot)klaver(at)aklaver(dot)com>, "'PostgreSQL'" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: Remote Connection Help
Date: 2019-11-21 17:44:22
Message-ID: !&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo/YBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAABIf3q6Pk74Q4+JJTp/7lSbAQAAAAA=@alphagenius.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I connected to PostgreSQL locally. I ran “show listen_addresses;” and it returned “localhost.” I ran “show port;” and it returned “5432.” I am now confused. I edited the “postgresql.conf” file and change the setting to ‘*’. Then I restarted the server with “service postgresql restart.” I was in root since I had to edit the config files. I thought maybe I edited the wrong file, like maybe there were two in two different locations or something. I ran “show confg_file;” and it returned “/usr/local/psql/data/postgresql.conf.” That is the same file I edited from the start. To be sure, I edited the file by using “nano /usr/local/psql/data/postgresql.conf.” I went down and found that I did have it as “listen_addresses = ‘*’ yet when I run “show listen_addresses”, it shows “localhost.” I am confused. When I run “netstat -nlt”, the results show that it is listening to “127.0.0.1:5432.”

Jason L. Amerson

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Sent: Thursday, November 21, 2019 12:05 PM
To: Jason L. Amerson <drjason(at)alphagenius(dot)org>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>; PostgreSQL <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Remote Connection Help

On Thu, Nov 21, 2019 at 8:48 AM Jason L. Amerson <drjason(at)alphagenius(dot)org <mailto:drjason(at)alphagenius(dot)org> > wrote:

1) I am not sure if Postgres server is listening on port 5432. How do I
check?

2) I have tried "psql -h xx.xx.xx.xx" and "psql -h xx.xx.xx.xx -U postgres."
I even tried to telnet to it using the static IP and port 5432 but it would
not connect. I can connect to it remotely using the static IP with SSH.

3) It is my own physical machine. It is running Ubuntu and has a static IP.

Jason L. Amerson

....

Can you connect locally? I.e. on the machine running PostgreSQL? If so, you can run:

show listen_addresses;

and

show port;

to verify the settings. On some distros (including Ubuntu) you can have PostgreSQL running on a non-standard port due to an upgrade or installation of multiple versions.

Other thoughts. Did you restart PostgreSQL after changing settings? Are you sure that you are editing the postgresql.conf file associated with your running instance? Is there anything on the *client* machine or between the client machine and your PostgreSQL server that could be blocking ports? Have you used netstat or lsof to verify that PostgreSQL is listening on 5432?

Cheers,

Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-11-21 18:18:02 Re: Remote Connection Help
Previous Message Pavel Stehule 2019-11-21 17:13:56 Re: Adding LIMIT changes PostgreSQL plan from good to a bad one