pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedRemote Connection Help
37+ messages / 10 participants
[nested] [flat]
* Remote Connection Help
@ 2019-11-21 14:21 Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 14:30 ` Re: Remote Connection Help Ekaterina Amez <ekaterina.amez@zunibal.com>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:27 ` Re: [SPAM] Remote Connection Help Moreno Andreo <moreno.andreo@evolu-s.it>
0 siblings, 3 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 14:21 UTC (permalink / raw)
To: PostgreSQL <pgsql-general@lists.postgresql.org>
I am at a loss for what to do. I have read article after article about how
to allow remote connections on my PostgreSQL server and none of what the
articles say do, worked for me. I have edited the "postgresql.conf" file and
changed "listen_address = 'localhost' to listen_address = '*'. I have even
tried it commented out and uncommented and I get the same results. I also
edited the "pg_hba.conf" file and added the following at the end of the
file:
host all all 0.0.0.0/0 md5
host all all ::/0 md5
After that I restart the server, try to connect remotely, and I get nowhere.
I have even added the following rules to my iptables:
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx --dport
5432 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport
1024:65535 -m state --state ESTABLISHED -j ACCEPT
My computer that is running the server is Ubuntu and it has a static IP. I
am trying to connect remotely with computers running Windows 10 using the
static IP. When I run pgAdmin from my Windows 10 machine, or use the command
line to connect, I get the following error:
unable to connect to server:
could not connect to server: Connection refused (Ox0000274D/10061) Is the
server running on host " xx.xx.xx.xx" and accepting
TCP/IP connections on port 5432'
I would like to be able to connect to my Ubuntu PostgreSQL server from all
Windows 10 machines as well as from a client on my Android phone while away
from home. That is my goal now. I am hoping that someone can help me to get
this working. This is been very frustrating.
Attachments:
image001.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 14:30 ` Ekaterina Amez <ekaterina.amez@zunibal.com>
2019-11-21 14:48 ` Re: Remote Connection Help Steve Atkins <steve@blighty.com>
2 siblings, 1 reply; 37+ messages in thread
From: Ekaterina Amez @ 2019-11-21 14:30 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
El 21/11/19 a las 15:21, Jason L. Amerson escribió:
>
> I am at a loss for what to do. I have read article after article about
> how to allow remote connections on my PostgreSQL server and none of
> what the articles say do, worked for me. I have edited the
> “postgresql.conf” file and changed “listen_address = ‘localhost’ to
> listen_address = ‘*’. I have even tried it commented out and
> uncommented and I get the same results. I also edited the
> “pg_hba.conf” file and added the following at the end of the file:
>
> host all all 0.0.0.0/0 md5
>
> host all all ::/0 md5
>
For testing connection purposes I'm used to change md5 to trust, this
way you won't have troubles with passwords nor users.
> After that I restart the server, try to connect remotely, and I get
> nowhere. I have even added the following rules to my iptables:
>
> iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx
> --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
>
> iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport
> 1024:65535 -m state --state ESTABLISHED -j ACCEPT
>
Have you tried turning of iptables service? If you turn it off and try
to connect remotely after that, you can test if the problem is in
iptables or not.
> My computer that is running the server is Ubuntu and it has a static
> IP. I am trying to connect remotely with computers running Windows 10
> using the static IP. When I run pgAdmin from my Windows 10 machine, or
> use the command line to connect, I get the following error:
>
> unable to connect to server:
>
> could not connect to server: Connection refused (Ox0000274D/10061) Is
> the server running on host " xx.xx.xx.xx" and accepting
>
> TCP/IP connections on port 5432'
>
> I would like to be able to connect to my Ubuntu PostgreSQL server from
> all Windows 10 machines as well as from a client on my Android phone
> while away from home. That is my goal now. I am hoping that someone
> can help me to get this working. This is been very frustrating.
>
Attachments:
image001.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 14:30 ` Re: Remote Connection Help Ekaterina Amez <ekaterina.amez@zunibal.com>
@ 2019-11-21 14:48 ` Steve Atkins <steve@blighty.com>
2019-11-21 15:35 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 1 reply; 37+ messages in thread
From: Steve Atkins @ 2019-11-21 14:48 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 21/11/2019 14:30, Ekaterina Amez wrote:
> El 21/11/19 a las 15:21, Jason L. Amerson escribió:
>>
>> I am at a loss for what to do. I have read article after article
>> about how to allow remote connections on my PostgreSQL server and
>> none of what the articles say do, worked for me. I have edited the
>> “postgresql.conf” file and changed “listen_address = ‘localhost’ to
>> listen_address = ‘*’.
>>
I think that's "listen_addresses" on recent versions of postgresql.
Did you stop and restart the service after you edited the config file?
Check the logs for errors too, maybe.
>> I have even tried it commented out and uncommented and I get the same
>> results. I also edited the “pg_hba.conf” file and added the following
>> at the end of the file:
>>
>> host all all 0.0.0.0/0 md5
>>
>> host all all ::/0 md5
>>
The first line in pg_hba.conf that matches a connection will take
effect; later lines won't.
>
> For testing connection purposes I'm used to change md5 to trust, this
> way you won't have troubles with passwords nor users.
>
Don't do this on a machine that's reachable from the open internet,
ever. It's asking to get your box compromised.
>> My computer that is running the server is Ubuntu and it has a static
>> IP. I am trying to connect remotely with computers running Windows 10
>> using the static IP. When I run pgAdmin from my Windows 10 machine,
>> or use the command line to connect, I get the following error:
>>
>> unable to connect to server:
>>
>> could not connect to server: Connection refused (Ox0000274D/10061) Is
>> the server running on host " xx.xx.xx.xx" and accepting
>>
>> TCP/IP connections on port 5432'
>>
>> I would like to be able to connect to my Ubuntu PostgreSQL server
>> from all Windows 10 machines as well as from a client on my Android
>> phone while away from home. That is my goal now. I am hoping that
>> someone can help me to get this working. This is been very frustrating.
>>
Can you connect to your server on it's external address at all? i.e. if
it's external IP address is 10.11.12.13, can you run "psql -h
10.11.12.13" on your ubuntu box and connect / log in?
If you can then postgresql is configured correctly and you can focus on
where the issue on the network is.
If not, then the problem is the local machine, either postgresql
configuration or _maybe_ local network configuration silliness.
Cheers,
Steve
Attachments:
image001.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 14:30 ` Re: Remote Connection Help Ekaterina Amez <ekaterina.amez@zunibal.com>
2019-11-21 14:48 ` Re: Remote Connection Help Steve Atkins <steve@blighty.com>
@ 2019-11-21 15:35 ` Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 15:35 UTC (permalink / raw)
To: 'Steve Atkins' <steve@blighty.com>; pgsql-general@lists.postgresql.org
I cannot connect to the server by “psql -h xx.xx.xx.xx.” I can connect to my
Ubuntu machine from other computers using SSH and I can connect to
PostgreSQL if I SSH first. But I cannot connect directly to PostgreSQL
either through a client machine or if I run “psql -h xx.xx.xx.xx” while
using my Ubuntu machine.
Jason L. Amerson
From: Steve Atkins <steve@blighty.com>
Sent: Thursday, November 21, 2019 09:49 AM
To: pgsql-general@lists.postgresql.org
Subject: Re: Remote Connection Help
On 21/11/2019 14:30, Ekaterina Amez wrote:
El 21/11/19 a las 15:21, Jason L. Amerson escribió:
I am at a loss for what to do. I have read article after article about how
to allow remote connections on my PostgreSQL server and none of what the
articles say do, worked for me. I have edited the “postgresql.conf” file and
changed “listen_address = ‘localhost’ to listen_address = ‘*’.
I think that's "listen_addresses" on recent versions of postgresql.
Did you stop and restart the service after you edited the config file? Check
the logs for errors too, maybe.
I have even tried it commented out and uncommented and I get the same
results. I also edited the “pg_hba.conf” file and added the following at the
end of the file:
host all all 0.0.0.0/0 md5
host all all ::/0 md5
The first line in pg_hba.conf that matches a connection will take effect;
later lines won't.
For testing connection purposes I'm used to change md5 to trust, this way
you won't have troubles with passwords nor users.
Don't do this on a machine that's reachable from the open internet, ever.
It's asking to get your box compromised.
My computer that is running the server is Ubuntu and it has a static IP. I
am trying to connect remotely with computers running Windows 10 using the
static IP. When I run pgAdmin from my Windows 10 machine, or use the command
line to connect, I get the following error:
unable to connect to server:
could not connect to server: Connection refused (Ox0000274D/10061) Is the
server running on host " xx.xx.xx.xx" and accepting
TCP/IP connections on port 5432'
I would like to be able to connect to my Ubuntu PostgreSQL server from all
Windows 10 machines as well as from a client on my Android phone while away
from home. That is my goal now. I am hoping that someone can help me to get
this working. This is been very frustrating.
Can you connect to your server on it's external address at all? i.e. if it's
external IP address is 10.11.12.13, can you run "psql -h 10.11.12.13" on
your ubuntu box and connect / log in?
If you can then postgresql is configured correctly and you can focus on
where the issue on the network is.
If not, then the problem is the local machine, either postgresql
configuration or _maybe_ local network configuration silliness.
Cheers,
Steve
Attachments:
image001.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 15:15 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2 siblings, 1 reply; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 15:15 UTC (permalink / raw)
To: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Steve,
I cannot connect to the server by "psql -h xx.xx.xx.xx." I can connect to my
Ubuntu machine from other computers using SSH and I can connect to
PostgreSQL if I SSH first. But I cannot connect directly to PostgreSQL
either through a client machine or if I run "psql -h xx.xx.xx.xx" while
using my Ubuntu machine.
Jason L. Amerson
From: Jason L. Amerson <drjason@alphagenius.org>
Sent: Thursday, November 21, 2019 09:22 AM
To: PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Remote Connection Help
I am at a loss for what to do. I have read article after article about how
to allow remote connections on my PostgreSQL server and none of what the
articles say do, worked for me. I have edited the "postgresql.conf" file and
changed "listen_address = 'localhost' to listen_address = '*'. I have even
tried it commented out and uncommented and I get the same results. I also
edited the "pg_hba.conf" file and added the following at the end of the
file:
host all all 0.0.0.0/0 md5
host all all ::/0 md5
After that I restart the server, try to connect remotely, and I get nowhere.
I have even added the following rules to my iptables:
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx --dport
5432 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport
1024:65535 -m state --state ESTABLISHED -j ACCEPT
My computer that is running the server is Ubuntu and it has a static IP. I
am trying to connect remotely with computers running Windows 10 using the
static IP. When I run pgAdmin from my Windows 10 machine, or use the command
line to connect, I get the following error:
unable to connect to server:
could not connect to server: Connection refused (Ox0000274D/10061) Is the
server running on host " xx.xx.xx.xx" and accepting
TCP/IP connections on port 5432'
I would like to be able to connect to my Ubuntu PostgreSQL server from all
Windows 10 machines as well as from a client on my Android phone while away
from home. That is my goal now. I am hoping that someone can help me to get
this working. This is been very frustrating.
Attachments:
image002.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 16:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 1 reply; 37+ messages in thread
From: Adrian Klaver @ 2019-11-21 16:10 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/21/19 7:15 AM, Jason L. Amerson wrote:
> Steve,
>
> I cannot connect to the server by “psql -h xx.xx.xx.xx.” I can connect
> to my Ubuntu machine from other computers using SSH and I can connect to
> PostgreSQL if I SSH first. But I cannot connect directly to PostgreSQL
> either through a client machine or if I run “psql -h xx.xx.xx.xx” while
> using my Ubuntu machine.
1) Is the Postgres server listening on port 5432?
2) What is the full remote connection string you are using?
3) What is the remote machine, a hosted virtual machine, your own
physical machine, etc?
>
> Jason L. Amerson
>
> *From:*Jason L. Amerson <drjason@alphagenius.org>
> *Sent:* Thursday, November 21, 2019 09:22 AM
> *To:* PostgreSQL <pgsql-general@lists.postgresql.org>
> *Subject:* Remote Connection Help
>
> I am at a loss for what to do. I have read article after article about
> how to allow remote connections on my PostgreSQL server and none of what
> the articles say do, worked for me. I have edited the “postgresql.conf”
> file and changed “listen_address = ‘localhost’ to listen_address = ‘*’.
> I have even tried it commented out and uncommented and I get the same
> results. I also edited the “pg_hba.conf” file and added the following at
> the end of the file:
>
> host all all 0.0.0.0/0 md5
>
> host all all ::/0 md5
>
> After that I restart the server, try to connect remotely, and I get
> nowhere. I have even added the following rules to my iptables:
>
> iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx
> --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
>
> iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport
> 1024:65535 -m state --state ESTABLISHED -j ACCEPT
>
> My computer that is running the server is Ubuntu and it has a static IP.
> I am trying to connect remotely with computers running Windows 10 using
> the static IP. When I run pgAdmin from my Windows 10 machine, or use the
> command line to connect, I get the following error:
>
> unable to connect to server:
>
> could not connect to server: Connection refused (Ox0000274D/10061) Is
> the server running on host " xx.xx.xx.xx" and accepting
>
> TCP/IP connections on port 5432'
>
> I would like to be able to connect to my Ubuntu PostgreSQL server from
> all Windows 10 machines as well as from a client on my Android phone
> while away from home. That is my goal now. I am hoping that someone can
> help me to get this working. This is been very frustrating.
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-21 16:47 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
0 siblings, 1 reply; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 16:47 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
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
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Thursday, November 21, 2019 11:11 AM
To: Jason L. Amerson <drjason@alphagenius.org>; 'PostgreSQL'
<pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/21/19 7:15 AM, Jason L. Amerson wrote:
> Steve,
>
> I cannot connect to the server by "psql -h xx.xx.xx.xx." I can connect
> to my Ubuntu machine from other computers using SSH and I can connect
> to PostgreSQL if I SSH first. But I cannot connect directly to
> PostgreSQL either through a client machine or if I run "psql -h
> xx.xx.xx.xx" while using my Ubuntu machine.
1) Is the Postgres server listening on port 5432?
2) What is the full remote connection string you are using?
3) What is the remote machine, a hosted virtual machine, your own physical
machine, etc?
>
> Jason L. Amerson
>
> *From:*Jason L. Amerson <drjason@alphagenius.org>
> *Sent:* Thursday, November 21, 2019 09:22 AM
> *To:* PostgreSQL <pgsql-general@lists.postgresql.org>
> *Subject:* Remote Connection Help
>
> I am at a loss for what to do. I have read article after article about
> how to allow remote connections on my PostgreSQL server and none of
> what the articles say do, worked for me. I have edited the
"postgresql.conf"
> file and changed "listen_address = 'localhost' to listen_address = '*'.
> I have even tried it commented out and uncommented and I get the same
> results. I also edited the "pg_hba.conf" file and added the following
> at the end of the file:
>
> host all all 0.0.0.0/0 md5
>
> host all all ::/0 md5
>
> After that I restart the server, try to connect remotely, and I get
> nowhere. I have even added the following rules to my iptables:
>
> iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d xx.xx.xx.xx
> --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
>
> iptables -A OUTPUT -p tcp -s xx.xx.xx.xx --sport 5432 -d 0/0 --dport
> 1024:65535 -m state --state ESTABLISHED -j ACCEPT
>
> My computer that is running the server is Ubuntu and it has a static IP.
> I am trying to connect remotely with computers running Windows 10
> using the static IP. When I run pgAdmin from my Windows 10 machine, or
> use the command line to connect, I get the following error:
>
> unable to connect to server:
>
> could not connect to server: Connection refused (Ox0000274D/10061) Is
> the server running on host " xx.xx.xx.xx" and accepting
>
> TCP/IP connections on port 5432'
>
> I would like to be able to connect to my Ubuntu PostgreSQL server from
> all Windows 10 machines as well as from a client on my Android phone
> while away from home. That is my goal now. I am hoping that someone
> can help me to get this working. This is been very frustrating.
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 17:05 ` Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 1 reply; 37+ messages in thread
From: Steve Crawford @ 2019-11-21 17:05 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
On Thu, Nov 21, 2019 at 8:48 AM Jason L. Amerson <drjason@alphagenius.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
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
@ 2019-11-21 17:44 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 17:44 UTC (permalink / raw)
To: 'Steve Crawford' <scrawford@pinpointresearch.com>; +Cc: 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
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@pinpointresearch.com>
Sent: Thursday, November 21, 2019 12:05 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On Thu, Nov 21, 2019 at 8:48 AM Jason L. Amerson <drjason@alphagenius.org <mailto:drjason@alphagenius.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
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 18:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 1 reply; 37+ messages in thread
From: Tom Lane @ 2019-11-21 18:18 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> 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.”
According to what you wrote here, you did everything right, so it's
something you failed to mention.
One thing I'm wondering is whether you removed the comment symbol (#)
from the listen_addresses line when you edited it. As installed,
postgresql.conf is pretty much all comments.
You might get more insight from
select * from pg_settings where name = 'listen_addresses';
particularly the source, sourcefile, sourceline fields.
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 18:40 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:02 ` Re: Remote Connection Help Mark Johnson <remi9898@gmail.com>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 18:40 UTC (permalink / raw)
To: 'Tom Lane' <tgl@sss.pgh.pa.us>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Yes "listen_addresses" is not commented. I did notice when I did the netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but I have a listing for tcp6 that has my static IP using port 32305. Would that make a difference?
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, November 21, 2019 01:18 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> 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.”
According to what you wrote here, you did everything right, so it's something you failed to mention.
One thing I'm wondering is whether you removed the comment symbol (#) from the listen_addresses line when you edited it. As installed, postgresql.conf is pretty much all comments.
You might get more insight from
select * from pg_settings where name = 'listen_addresses';
particularly the source, sourcefile, sourceline fields.
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 19:02 ` Mark Johnson <remi9898@gmail.com>
2019-11-21 19:43 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:53 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 2 replies; 37+ messages in thread
From: Mark Johnson @ 2019-11-21 19:02 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Steve Crawford <scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
As I recall, if the listening address is set to '*' but is showing
localhost, then the problem you describe is likely due to missing an IPv6
address in pg_hba.conf. For me, I just added a line to pg_hba.conf like
this:
host all all ::1/128 md5
So, even though my client app is on the db server and the connection string
has an IPv4 address the connection request still gets to PostgreSQL as IPv6
and fails until I added the line shown above.
Did your netstat output have two lines for the port numbers used by
PostgreSQL or just one of them? My computer has two like this,
$ netstat -nlt | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
tcp6 0 0 ::1:5432 :::* LISTEN
On Thu, Nov 21, 2019 at 1:41 PM Jason L. Amerson <drjason@alphagenius.org>
wrote:
> Yes "listen_addresses" is not commented. I did notice when I did the
> netstat, for tcp, it was all "127.0.0.1" on various ports including 5432
> but I have a listing for tcp6 that has my static IP using port 32305. Would
> that make a difference?
>
> Jason L. Amerson
>
> -----Original Message-----
> From: Tom Lane <tgl@sss.pgh.pa.us>
> Sent: Thursday, November 21, 2019 01:18 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <
> adrian.klaver@aklaver.com>; 'PostgreSQL' <
> pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> "Jason L. Amerson" <drjason@alphagenius.org> writes:
> > 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.”
>
> According to what you wrote here, you did everything right, so it's
> something you failed to mention.
>
> One thing I'm wondering is whether you removed the comment symbol (#) from
> the listen_addresses line when you edited it. As installed,
> postgresql.conf is pretty much all comments.
>
> You might get more insight from
>
> select * from pg_settings where name = 'listen_addresses';
>
> particularly the source, sourcefile, sourceline fields.
>
> regards, tom lane
>
>
>
>
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:02 ` Re: Remote Connection Help Mark Johnson <remi9898@gmail.com>
@ 2019-11-21 19:43 ` Jason L. Amerson <drjason@alphagenius.org>
1 sibling, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 19:43 UTC (permalink / raw)
To: 'Mark Johnson' <remi9898@gmail.com>; +Cc: 'Tom Lane' <tgl@sss.pgh.pa.us>; 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
I went back and added the line you suggested to my “pg_hba” file so the end of mine now looks like this:
host all all 0.0.0.0/0 md5
host all all ::1/128 md5
When I run “netstat -nlt | grep 5432”, I still only get “tcp 127.0.0.1:5432.” As I mentioned before, I also see "127.0.0.1" on various ports including 5432 but I have a listing for tcp6 that has my static IP using port 32305. Is it supposed to be like that? Also, her is the weird thing, I have two “postgresql.conf” and “pg_hba” files in two different locations. I have one in “/usr/local/pgsql/data” and another set at “/etc/postgresql/9.4/main.” I just discovered this situation. I edited both sets of files to have the same setting and still nothing. It seems that something very screwy is going on.
Jason L. Amerson
From: Mark Johnson <remi9898@gmail.com>
Sent: Thursday, November 21, 2019 02:02 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Steve Crawford <scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
As I recall, if the listening address is set to '*' but is showing localhost, then the problem you describe is likely due to missing an IPv6 address in pg_hba.conf. For me, I just added a line to pg_hba.conf like this:
host all all ::1/128 md5
So, even though my client app is on the db server and the connection string has an IPv4 address the connection request still gets to PostgreSQL as IPv6 and fails until I added the line shown above.
Did your netstat output have two lines for the port numbers used by PostgreSQL or just one of them? My computer has two like this,
$ netstat -nlt | grep 5432
tcp 0 0 127.0.0.1:5432 <http://127.0.0.1:5432; 0.0.0.0:* LISTEN
tcp6 0 0 ::1:5432 :::* LISTEN
On Thu, Nov 21, 2019 at 1:41 PM Jason L. Amerson <drjason@alphagenius.org <mailto:drjason@alphagenius.org> > wrote:
Yes "listen_addresses" is not commented. I did notice when I did the netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but I have a listing for tcp6 that has my static IP using port 32305. Would that make a difference?
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us> >
Sent: Thursday, November 21, 2019 01:18 PM
To: Jason L. Amerson <drjason@alphagenius.org <mailto:drjason@alphagenius.org> >
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com <mailto:scrawford@pinpointresearch.com> >; 'Adrian Klaver' <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com> >; 'PostgreSQL' <pgsql-general@lists.postgresql.org <mailto:pgsql-general@lists.postgresql.org> >
Subject: Re: Remote Connection Help
"Jason L. Amerson" <drjason@alphagenius.org <mailto:drjason@alphagenius.org> > writes:
> 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.”
According to what you wrote here, you did everything right, so it's something you failed to mention.
One thing I'm wondering is whether you removed the comment symbol (#) from the listen_addresses line when you edited it. As installed, postgresql.conf is pretty much all comments.
You might get more insight from
select * from pg_settings where name = 'listen_addresses';
particularly the source, sourcefile, sourceline fields.
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:02 ` Re: Remote Connection Help Mark Johnson <remi9898@gmail.com>
@ 2019-11-21 19:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 19:56 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
1 sibling, 1 reply; 37+ messages in thread
From: Tom Lane @ 2019-11-21 19:53 UTC (permalink / raw)
To: Mark Johnson <remi9898@gmail.com>; +Cc: Jason L. Amerson <drjason@alphagenius.org>; Steve Crawford <scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
Mark Johnson <remi9898@gmail.com> writes:
> As I recall, if the listening address is set to '*' but is showing
> localhost, then the problem you describe is likely due to missing an IPv6
> address in pg_hba.conf.
No, the contents of pg_hba.conf don't directly impact the listen_addresses
setting. Also, if that's where the problem is, I'd expect a failure
complaining about "no pg_hba.conf entry for <connection info>". The
reported "connection refused" message suggests strongly that the
postmaster isn't actually listening on the desired port, which also
implicates listen_addresses rather than anything else. (I think it
could also be caused by a firewall filter, if the firewall is configured
to send back a TCP RST rather than just drop the packet. But if "show
listen_addresses" isn't showing what we expect, that's the first thing
to fix.)
The OP may well need to adjust pg_hba.conf too, but he's not got
that far yet :-(
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:02 ` Re: Remote Connection Help Mark Johnson <remi9898@gmail.com>
2019-11-21 19:53 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 19:56 ` Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 19:56 UTC (permalink / raw)
To: 'Tom Lane' <tgl@sss.pgh.pa.us>; 'Mark Johnson' <remi9898@gmail.com>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
pg_settings still show localhost. I went back and added the line that
someone suggested to my "pg_hba" file so the end of mine now looks like
this:
host all all 0.0.0.0/0 md5
host all all ::1/128 md5
When I run "netstat -nlt | grep 5432", I still only get "tcp
127.0.0.1:5432." As I mentioned be-fore, I also see "127.0.0.1" on various
ports including 5432 but I have a listing for tcp6 that has my static IP
using port 32305. Is it supposed to be like that? Also, her is the weird
thing, I have two "postgresql.conf" and "pg_hba" files in two different
locations. I have one in "/usr/local/pgsql/data" and another set at
"/etc/postgresql/9.4/main." I just discovered this situation. I edited both
sets of files to have the same setting and still nothing. It seems that
some-thing very screwy is going on.
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, November 21, 2019 02:53 PM
To: Mark Johnson <remi9898@gmail.com>
Cc: Jason L. Amerson <drjason@alphagenius.org>; Steve Crawford
<scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>;
PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
Mark Johnson <remi9898@gmail.com> writes:
> As I recall, if the listening address is set to '*' but is showing
> localhost, then the problem you describe is likely due to missing an
> IPv6 address in pg_hba.conf.
No, the contents of pg_hba.conf don't directly impact the listen_addresses
setting. Also, if that's where the problem is, I'd expect a failure
complaining about "no pg_hba.conf entry for <connection info>". The
reported "connection refused" message suggests strongly that the postmaster
isn't actually listening on the desired port, which also implicates
listen_addresses rather than anything else. (I think it could also be
caused by a firewall filter, if the firewall is configured to send back a
TCP RST rather than just drop the packet. But if "show listen_addresses"
isn't showing what we expect, that's the first thing to fix.)
The OP may well need to adjust pg_hba.conf too, but he's not got that far
yet :-(
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 19:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:31 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:52 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:05 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
1 sibling, 4 replies; 37+ messages in thread
From: Tom Lane @ 2019-11-21 19:41 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> Yes "listen_addresses" is not commented. I did notice when I did the netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but I have a listing for tcp6 that has my static IP using port 32305. Would that make a difference?
Hm, well, *something* is overriding the setting. What did you
find in pg_settings?
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 20:07 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 20:16 ` Re: Remote Connection Help Andrew Kerber <andrew.kerber@gmail.com>
3 siblings, 2 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 20:07 UTC (permalink / raw)
To: 'Tom Lane' <tgl@sss.pgh.pa.us>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
pg_settings show localhost.
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, November 21, 2019 02:42 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
<adrian.klaver@aklaver.com>; 'PostgreSQL'
<pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> Yes "listen_addresses" is not commented. I did notice when I did the
netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but
I have a listing for tcp6 that has my static IP using port 32305. Would that
make a difference?
Hm, well, *something* is overriding the setting. What did you find in
pg_settings?
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 20:16 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
1 sibling, 1 reply; 37+ messages in thread
From: Adrian Klaver @ 2019-11-21 20:16 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/21/19 12:07 PM, Jason L. Amerson wrote:
> pg_settings show localhost.
Lets back up a bit and:
1) Show output of ps ax | grep post on Ubuntu machine.
2) Explain how you installed Postgres, source, package and if
package from what repo?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Tom Lane <tgl@sss.pgh.pa.us>
> Sent: Thursday, November 21, 2019 02:42 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
> <adrian.klaver@aklaver.com>; 'PostgreSQL'
> <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> "Jason L. Amerson" <drjason@alphagenius.org> writes:
>> Yes "listen_addresses" is not commented. I did notice when I did the
> netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but
> I have a listing for tcp6 that has my static IP using port 32305. Would that
> make a difference?
>
> Hm, well, *something* is overriding the setting. What did you find in
> pg_settings?
>
> regards, tom lane
>
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-21 21:14 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:22 ` Re: Remote Connection Help Andrew Kerber <andrew.kerber@gmail.com>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:53 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 3 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 21:14 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
sudo ./configure
make world
su
make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
Then I set the following environment variables:
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
PATH=/usr/local/pgsql/bin:$PATH
export PATH
MANPATH=/usr/local/pgsql/share/man:$MANPATH
export MANPATH
Jason L. Amerson
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Thursday, November 21, 2019 03:17 PM
To: Jason L. Amerson <drjason@alphagenius.org>; 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/21/19 12:07 PM, Jason L. Amerson wrote:
> pg_settings show localhost.
Lets back up a bit and:
1) Show output of ps ax | grep post on Ubuntu machine.
2) Explain how you installed Postgres, source, package and if package from what repo?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Tom Lane <tgl@sss.pgh.pa.us>
> Sent: Thursday, November 21, 2019 02:42 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
> <adrian.klaver@aklaver.com>; 'PostgreSQL'
> <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> "Jason L. Amerson" <drjason@alphagenius.org> writes:
>> Yes "listen_addresses" is not commented. I did notice when I did the
> netstat, for tcp, it was all "127.0.0.1" on various ports including
> 5432 but I have a listing for tcp6 that has my static IP using port
> 32305. Would that make a difference?
>
> Hm, well, *something* is overriding the setting. What did you find in
> pg_settings?
>
> regards, tom lane
>
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
Attachments:
PS AX.jpg (image/jpeg, 706.0K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 21:22 ` Andrew Kerber <andrew.kerber@gmail.com>
2 siblings, 0 replies; 37+ messages in thread
From: Andrew Kerber @ 2019-11-21 21:22 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Adrian Klaver <adrian.klaver@aklaver.com>; Steve Crawford <scrawford@pinpointresearch.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
change your listen_on setting to '*'
and add an entry to your hosts file for your machine.something like this:
192.168.1.10 thuban.mydomain thuban
Replace 192.168.1.10 with your ip address.
On Thu, Nov 21, 2019 at 3:14 PM Jason L. Amerson <drjason@alphagenius.org>
wrote:
> 1) I have attached a screenshot of the output of "ps ax | grep post" on
> the Ubuntu machine.
>
> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did
> install from source which I already knew how to do. I got the source
> package from PostgreSQL. I basically followed these instructions:
>
> sudo ./configure
> make world
> su
> make install
> adduser postgres
> mkdir /usr/local/pgsql/data
> chown postgres /usr/local/pgsql/data
> su - postgres
> /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
> /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
> /usr/local/pgsql/bin/createdb test
> /usr/local/pgsql/bin/psql test
>
> Then I set the following environment variables:
>
> LD_LIBRARY_PATH=/usr/local/pgsql/lib
> export LD_LIBRARY_PATH
>
> PATH=/usr/local/pgsql/bin:$PATH
> export PATH
>
> MANPATH=/usr/local/pgsql/share/man:$MANPATH
> export MANPATH
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Thursday, November 21, 2019 03:17 PM
> To: Jason L. Amerson <drjason@alphagenius.org>; 'Tom Lane' <
> tgl@sss.pgh.pa.us>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <
> pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/21/19 12:07 PM, Jason L. Amerson wrote:
> > pg_settings show localhost.
>
> Lets back up a bit and:
>
> 1) Show output of ps ax | grep post on Ubuntu machine.
>
> 2) Explain how you installed Postgres, source, package and if package from
> what repo?
>
> >
> > Jason L. Amerson
> >
> >
> > -----Original Message-----
> > From: Tom Lane <tgl@sss.pgh.pa.us>
> > Sent: Thursday, November 21, 2019 02:42 PM
> > To: Jason L. Amerson <drjason@alphagenius.org>
> > Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
> > <adrian.klaver@aklaver.com>; 'PostgreSQL'
> > <pgsql-general@lists.postgresql.org>
> > Subject: Re: Remote Connection Help
> >
> > "Jason L. Amerson" <drjason@alphagenius.org> writes:
> >> Yes "listen_addresses" is not commented. I did notice when I did the
> > netstat, for tcp, it was all "127.0.0.1" on various ports including
> > 5432 but I have a listing for tcp6 that has my static IP using port
> > 32305. Would that make a difference?
> >
> > Hm, well, *something* is overriding the setting. What did you find in
> > pg_settings?
> >
> > regards, tom lane
> >
> >
> >
> >
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
--
Andrew W. Kerber
'If at first you dont succeed, dont take up skydiving.'
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 21:32 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2 siblings, 1 reply; 37+ messages in thread
From: Adrian Klaver @ 2019-11-21 21:32 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/21/19 1:14 PM, Jason L. Amerson wrote:
> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
What program are you using to SSH into the remote machine?
It should allow you to copy 'n' paste the screen output without
resorting to screenshots. Text is a lot handier and easy to read.
>
> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
One of your previous posts showed:
"/etc/postgresql/9.4/main."
which would indicate that Postgres was also installed using deb
packaging. This is something you probably want to follow up on as
different Postgres instances from different sources can be an issue in
and of itself.
In the meantime as to your issue:
1) What Postgres version did you install from source?
2) In /usr/local/pgsql/data what is the exact setting for
listen_addresses and port in postgresql.conf
>
> sudo ./configure
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-22 13:40 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 14:56 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 16:27 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
0 siblings, 2 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-22 13:40 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; +Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Adrian,
I originally did install PostgreSQL 12 from the repository. Then I removed it and decided to do it from source. I do have two postgresql.conf files and two pg_hba.conf files in two different locations. I guess I need to know which one to keep. When I enter SHOW config_file;, I get the location /usr/local/pgsql/data/postgresql.conf. There is a pg_hba.conf file in there too. Anyways, the version that I installed from source is version 12. The setting in postgresql.conf is listen_addresses = ‘*’ and the port is 5432. listen_addresses is uncommented but port is commented out.
Jason L. Amerson
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Thursday, November 21, 2019 04:32 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/21/19 1:14 PM, Jason L. Amerson wrote:
> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
What program are you using to SSH into the remote machine?
It should allow you to copy 'n' paste the screen output without resorting to screenshots. Text is a lot handier and easy to read.
>
> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
One of your previous posts showed:
"/etc/postgresql/9.4/main."
which would indicate that Postgres was also installed using deb packaging. This is something you probably want to follow up on as different Postgres instances from different sources can be an issue in and of itself.
In the meantime as to your issue:
1) What Postgres version did you install from source?
2) In /usr/local/pgsql/data what is the exact setting for listen_addresses and port in postgresql.conf
>
> sudo ./configure
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-22 14:56 ` Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 0 replies; 37+ messages in thread
From: Adrian Klaver @ 2019-11-22 14:56 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/22/19 5:40 AM, Jason L. Amerson wrote:
> Adrian,
>
> I originally did install PostgreSQL 12 from the repository. Then I removed it and decided to do it from source. I do have two postgresql.conf files and two pg_hba.conf files in
Well from your previous post "/etc/postgresql/9.4/main." That would
indicate there is also a 9.4 package installed or at least its conf
files. At the command line do:
pg_lsclusters
two different locations. I guess I need to know which one to keep. When
I enter SHOW config_file;, I get the location
/usr/local/pgsql/data/postgresql.conf. There is a pg_hba.conf file in
there too. Anyways, the version that I installed from source is version
12. The setting in postgresql.conf is listen_addresses = ‘*’ and the
port is 5432. listen_addresses is uncommented but port is commented out.
What do you see if in psql you do?:
select version();
In your screenshot for pg_settings the value for listen_addresses is
'localhost' and the source is default. That would indicate to me either
listen_addresses is not uncommented or the server was not restarted. In
any case that would be why you cannot connect remotely. Also the
sourcefile is NULL. This is either because the value is not coming from
a file or because you where not a superuser when you did the select on
pg_settings. Can you run the select as a superuser?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Thursday, November 21, 2019 04:32 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/21/19 1:14 PM, Jason L. Amerson wrote:
>> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>
> What program are you using to SSH into the remote machine?
> It should allow you to copy 'n' paste the screen output without resorting to screenshots. Text is a lot handier and easy to read.
>
>>
>> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>
> One of your previous posts showed:
>
> "/etc/postgresql/9.4/main."
>
> which would indicate that Postgres was also installed using deb packaging. This is something you probably want to follow up on as different Postgres instances from different sources can be an issue in and of itself.
>
> In the meantime as to your issue:
>
> 1) What Postgres version did you install from source?
>
> 2) In /usr/local/pgsql/data what is the exact setting for listen_addresses and port in postgresql.conf
>
>
>>
>> sudo ./configure
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-22 16:27 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 18:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
1 sibling, 1 reply; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-22 16:27 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; +Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
When I run pg_lsclusters, I get the following:
Ver Cluster Port Status Owner Data directory
9.4 main 5432 down postgres /var/lib/postgresql/9.4/main
Log file
/var/log/postgresql/postgresql-9.4-main.log
When I run select version();, I get the following:
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~
18.04.1) 7.4.0, 64-bit
(1 row)
I logged into root and tried to run select, and now I cannot log into the server under root. What the hell! I am so frustrated! This should not be so difficult. Obviously something is very screwed up with two servers. I would like to properly remove the repository version and all files and then uninstall the install I did from source code and get rid of any other files with that so that I can just start over. Will you please help me do this the best way? Will I have to manually remove some of the files associated with the two installs? I really appreciate how great everyone has been in helping me. I just do not want to waste any more of our time when I can just get rid of everything and start over.
Also, do my Windows 10 computers that will be clients, need PostgreSQL installed in order to connect remotely to my server or is pgAdmin or some other client all I need?
Jason L. Amerson
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Friday, November 22, 2019 09:56 AM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/22/19 5:40 AM, Jason L. Amerson wrote:
> Adrian,
>
> I originally did install PostgreSQL 12 from the repository. Then I
> removed it and decided to do it from source. I do have two
> postgresql.conf files and two pg_hba.conf files in
Well from your previous post "/etc/postgresql/9.4/main." That would indicate there is also a 9.4 package installed or at least its conf files. At the command line do:
pg_lsclusters
two different locations. I guess I need to know which one to keep. When I enter SHOW config_file;, I get the location /usr/local/pgsql/data/postgresql.conf. There is a pg_hba.conf file in there too. Anyways, the version that I installed from source is version 12. The setting in postgresql.conf is listen_addresses = ‘*’ and the port is 5432. listen_addresses is uncommented but port is commented out.
What do you see if in psql you do?:
select version();
In your screenshot for pg_settings the value for listen_addresses is 'localhost' and the source is default. That would indicate to me either listen_addresses is not uncommented or the server was not restarted. In any case that would be why you cannot connect remotely. Also the sourcefile is NULL. This is either because the value is not coming from a file or because you where not a superuser when you did the select on pg_settings. Can you run the select as a superuser?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Thursday, November 21, 2019 04:32 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL'
> <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/21/19 1:14 PM, Jason L. Amerson wrote:
>> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>
> What program are you using to SSH into the remote machine?
> It should allow you to copy 'n' paste the screen output without resorting to screenshots. Text is a lot handier and easy to read.
>
>>
>> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>
> One of your previous posts showed:
>
> "/etc/postgresql/9.4/main."
>
> which would indicate that Postgres was also installed using deb packaging. This is something you probably want to follow up on as different Postgres instances from different sources can be an issue in and of itself.
>
> In the meantime as to your issue:
>
> 1) What Postgres version did you install from source?
>
> 2) In /usr/local/pgsql/data what is the exact setting for
> listen_addresses and port in postgresql.conf
>
>
>>
>> sudo ./configure
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 16:27 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-22 18:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-23 17:03 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-23 18:20 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 37+ messages in thread
From: Adrian Klaver @ 2019-11-22 18:10 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/22/19 8:27 AM, Jason L. Amerson wrote:
> When I run pg_lsclusters, I get the following:
>
> Ver Cluster Port Status Owner Data directory
> 9.4 main 5432 down postgres /var/lib/postgresql/9.4/main
>
> Log file
> /var/log/postgresql/postgresql-9.4-main.log
>
> When I run select version();, I get the following:
>
> version
>
> --------------------------------------------------------------------------------------------------------------
> PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~
> 18.04.1) 7.4.0, 64-bit
> (1 row)
Alright so you are running the compiled version and you have a package
version which is not running.
>
> I logged into root and tried to run select, and now I cannot log into the server under root. What the hell! I am so frustrated! This should not be so difficult. Obviously something is very screwed up with two servers. I
I should have been more specific, I meant as database superuser(postgres).
would like to properly remove the repository version and all files and
then uninstall the install I did from source code and get rid of any
other files with that so that I can just start over. Will you please
help me do this the best way? Will I have to manually remove some of the
files associated with the two installs? I really appreciate how great
everyone has been in helping me. I just do not want to waste any more of
our time when I can just get rid of everything and start over.
Starting over sounds like a good idea. To that end:
1) Do you have data on the running Postgres server you care about?
If so use pg_dump to backup it up.
2) I would stick with the package system instead of compiling from source.
3) Uninstall the current package version(9.4).
4) Assuming you did the pg_dump from 1) or don't care about the data,
stop the compiled version. Then delete the /usr/local/pgsql/ directory
and clean up the /etc/init.d/. If you want to be extra safe you could
copy the previous to a backup location.
5) Decide where you want to get your packages from. I would suggest
using the Postgres community repo:
https://www.postgresql.org/download/linux/ubuntu/
https://wiki.postgresql.org/wiki/Apt
If you are not already then point at the above repo.
6) Follow instructions at link in 5) to install Postgres.
Substitute 12 for 11 if you want 12. FYI just specifying postgresql (no
-version) will get you the latest.
7) Assuming installing 12 then go to:
/etc/postgresql/12/main
to make the necessary changes to postgresql.conf and pg_hba.conf.
8) For using the Debian/Ubuntu Postgres cluster management take a look at:
https://wiki.debian.org/PostgreSql
>
> Also, do my Windows 10 computers that will be clients, need PostgreSQL installed in order to connect remotely to my server or is pgAdmin or some other client all I need?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Friday, November 22, 2019 09:56 AM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/22/19 5:40 AM, Jason L. Amerson wrote:
>> Adrian,
>>
>> I originally did install PostgreSQL 12 from the repository. Then I
>> removed it and decided to do it from source. I do have two
>> postgresql.conf files and two pg_hba.conf files in
>
> Well from your previous post "/etc/postgresql/9.4/main." That would indicate there is also a 9.4 package installed or at least its conf files. At the command line do:
>
> pg_lsclusters
>
> two different locations. I guess I need to know which one to keep. When I enter SHOW config_file;, I get the location /usr/local/pgsql/data/postgresql.conf. There is a pg_hba.conf file in there too. Anyways, the version that I installed from source is version 12. The setting in postgresql.conf is listen_addresses = ‘*’ and the port is 5432. listen_addresses is uncommented but port is commented out.
>
> What do you see if in psql you do?:
>
> select version();
>
> In your screenshot for pg_settings the value for listen_addresses is 'localhost' and the source is default. That would indicate to me either listen_addresses is not uncommented or the server was not restarted. In any case that would be why you cannot connect remotely. Also the sourcefile is NULL. This is either because the value is not coming from a file or because you where not a superuser when you did the select on pg_settings. Can you run the select as a superuser?
>
>>
>> Jason L. Amerson
>>
>>
>> -----Original Message-----
>> From: Adrian Klaver <adrian.klaver@aklaver.com>
>> Sent: Thursday, November 21, 2019 04:32 PM
>> To: Jason L. Amerson <drjason@alphagenius.org>
>> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL'
>> <pgsql-general@lists.postgresql.org>
>> Subject: Re: Remote Connection Help
>>
>> On 11/21/19 1:14 PM, Jason L. Amerson wrote:
>>> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>>
>> What program are you using to SSH into the remote machine?
>> It should allow you to copy 'n' paste the screen output without resorting to screenshots. Text is a lot handier and easy to read.
>>
>>>
>>> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>>
>> One of your previous posts showed:
>>
>> "/etc/postgresql/9.4/main."
>>
>> which would indicate that Postgres was also installed using deb packaging. This is something you probably want to follow up on as different Postgres instances from different sources can be an issue in and of itself.
>>
>> In the meantime as to your issue:
>>
>> 1) What Postgres version did you install from source?
>>
>> 2) In /usr/local/pgsql/data what is the exact setting for
>> listen_addresses and port in postgresql.conf
>>
>>
>>>
>>> sudo ./configure
>>
>>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 16:27 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 18:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-23 17:03 ` Jason L. Amerson <drjason@alphagenius.org>
1 sibling, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-23 17:03 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; +Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
I removed both version of PostgreSQL from Ubuntu. I had to delete some files manually. I used the repository to install PostgreSQL and then I configured it for remote access and now everything works great! I can log in from my Windows computers using pgAdmin. Thank you to you and everyone else who had the patience to work with me. I appreciate all of your help. I just have one last question. I see many tutorials on the Internet showing you how to setup iptables with PostgreSQL. Should I do this or not? I just wanted to ask before I did it and screwed something up and it would not have made that much difference.
Thanks again to everyone,
Jason L. Amerson
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Friday, November 22, 2019 01:11 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/22/19 8:27 AM, Jason L. Amerson wrote:
> When I run pg_lsclusters, I get the following:
>
> Ver Cluster Port Status Owner Data directory
> 9.4 main 5432 down postgres /var/lib/postgresql/9.4/main
>
> Log file
> /var/log/postgresql/postgresql-9.4-main.log
>
> When I run select version();, I get the following:
>
> version
>
> ----------------------------------------------------------------------
> ----------------------------------------
> PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
> 7.4.0-1ubuntu1~
> 18.04.1) 7.4.0, 64-bit
> (1 row)
Alright so you are running the compiled version and you have a package version which is not running.
>
> I logged into root and tried to run select, and now I cannot log into
> the server under root. What the hell! I am so frustrated! This should
> not be so difficult. Obviously something is very screwed up with two
> servers. I
I should have been more specific, I meant as database superuser(postgres).
would like to properly remove the repository version and all files and then uninstall the install I did from source code and get rid of any other files with that so that I can just start over. Will you please help me do this the best way? Will I have to manually remove some of the files associated with the two installs? I really appreciate how great everyone has been in helping me. I just do not want to waste any more of our time when I can just get rid of everything and start over.
Starting over sounds like a good idea. To that end:
1) Do you have data on the running Postgres server you care about?
If so use pg_dump to backup it up.
2) I would stick with the package system instead of compiling from source.
3) Uninstall the current package version(9.4).
4) Assuming you did the pg_dump from 1) or don't care about the data, stop the compiled version. Then delete the /usr/local/pgsql/ directory and clean up the /etc/init.d/. If you want to be extra safe you could copy the previous to a backup location.
5) Decide where you want to get your packages from. I would suggest using the Postgres community repo:
https://www.postgresql.org/download/linux/ubuntu/
https://wiki.postgresql.org/wiki/Apt
If you are not already then point at the above repo.
6) Follow instructions at link in 5) to install Postgres.
Substitute 12 for 11 if you want 12. FYI just specifying postgresql (no
-version) will get you the latest.
7) Assuming installing 12 then go to:
/etc/postgresql/12/main
to make the necessary changes to postgresql.conf and pg_hba.conf.
8) For using the Debian/Ubuntu Postgres cluster management take a look at:
https://wiki.debian.org/PostgreSql
>
> Also, do my Windows 10 computers that will be clients, need PostgreSQL installed in order to connect remotely to my server or is pgAdmin or some other client all I need?
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Friday, November 22, 2019 09:56 AM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/22/19 5:40 AM, Jason L. Amerson wrote:
>> Adrian,
>>
>> I originally did install PostgreSQL 12 from the repository. Then I
>> removed it and decided to do it from source. I do have two
>> postgresql.conf files and two pg_hba.conf files in
>
> Well from your previous post "/etc/postgresql/9.4/main." That would indicate there is also a 9.4 package installed or at least its conf files. At the command line do:
>
> pg_lsclusters
>
> two different locations. I guess I need to know which one to keep. When I enter SHOW config_file;, I get the location /usr/local/pgsql/data/postgresql.conf. There is a pg_hba.conf file in there too. Anyways, the version that I installed from source is version 12. The setting in postgresql.conf is listen_addresses = ‘*’ and the port is 5432. listen_addresses is uncommented but port is commented out.
>
> What do you see if in psql you do?:
>
> select version();
>
> In your screenshot for pg_settings the value for listen_addresses is 'localhost' and the source is default. That would indicate to me either listen_addresses is not uncommented or the server was not restarted. In any case that would be why you cannot connect remotely. Also the sourcefile is NULL. This is either because the value is not coming from a file or because you where not a superuser when you did the select on pg_settings. Can you run the select as a superuser?
>
>>
>> Jason L. Amerson
>>
>>
>> -----Original Message-----
>> From: Adrian Klaver <adrian.klaver@aklaver.com>
>> Sent: Thursday, November 21, 2019 04:32 PM
>> To: Jason L. Amerson <drjason@alphagenius.org>
>> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL'
>> <pgsql-general@lists.postgresql.org>
>> Subject: Re: Remote Connection Help
>>
>> On 11/21/19 1:14 PM, Jason L. Amerson wrote:
>>> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>>
>> What program are you using to SSH into the remote machine?
>> It should allow you to copy 'n' paste the screen output without resorting to screenshots. Text is a lot handier and easy to read.
>>
>>>
>>> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>>
>> One of your previous posts showed:
>>
>> "/etc/postgresql/9.4/main."
>>
>> which would indicate that Postgres was also installed using deb packaging. This is something you probably want to follow up on as different Postgres instances from different sources can be an issue in and of itself.
>>
>> In the meantime as to your issue:
>>
>> 1) What Postgres version did you install from source?
>>
>> 2) In /usr/local/pgsql/data what is the exact setting for
>> listen_addresses and port in postgresql.conf
>>
>>
>>>
>>> sudo ./configure
>>
>>
>
>
> --
> Adrian Klaver
> adrian.klaver@aklaver.com
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:32 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 16:27 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 18:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-23 18:20 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 37+ messages in thread
From: Tom Lane @ 2019-11-23 18:20 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> I removed both version of PostgreSQL from Ubuntu. I had to delete some
> files manually. I used the repository to install PostgreSQL and then I
> configured it for remote access and now everything works great! I can
> log in from my Windows computers using pgAdmin. Thank you to you and
> everyone else who had the patience to work with me. I appreciate all of
> your help. I just have one last question. I see many tutorials on the
> Internet showing you how to setup iptables with PostgreSQL. Should I do
> this or not?
Usually the reason for messing with iptables is either
1. You have to, because your machine's default firewall rules aren't
letting in connections to Postgres. You evidently haven't got that
problem.
2. You want to block off access to the database server from addresses
you don't trust. Configuring pg_hba.conf is typically a sufficient
answer for that; but you might want an iptables filter too, either
because you're a belt-and-suspenders-too kind of guy, or because you're
afraid of DDoS storms with more connection requests/sec than Postgres
can reject easily. I can't say whether either of those apply to you;
but I would note that the DDoS scenario only applies if your server
is reachable from the net-at-large, which is seldom a good idea in
the first place.
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 21:53 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:49 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2 siblings, 1 reply; 37+ messages in thread
From: Adrian Klaver @ 2019-11-21 21:53 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Steve Crawford <scrawford@pinpointresearch.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/21/19 1:14 PM, Jason L. Amerson wrote:
> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>
> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>
Additional questions that came to mind:
1) How are you starting/stopping server?
2) What do you see on the terminal when you restart the server? I see:
aklaver@ranger:~> sudo /etc/init.d/postgresql11 restart
Restarting PostgreSQL: ok
aklaver@ranger:~> -2019-11-21 13:49:30.104 PST-0LOG: listening on IPv6
address "::1", port 5432
-2019-11-21 13:49:30.104 PST-0LOG: listening on IPv4 address
"127.0.0.1", port 5432
-2019-11-21 13:49:30.193 PST-0LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
-2019-11-21 13:49:30.322 PST-0LOG: redirecting log output to logging
collector process
-2019-11-21 13:49:30.322 PST-0HINT: Future log output will appear in
directory "log".
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:53 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
@ 2019-11-22 13:49 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 15:56 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 1 reply; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-22 13:49 UTC (permalink / raw)
To: 'Adrian Klaver' <adrian.klaver@aklaver.com>; +Cc: 'PostgreSQL' <pgsql-general@lists.postgresql.org>
I am start/stopping the server by using sudo service postgresql start/stop/restart/status. When I run any of these commands, I do not get anything. No confirmation, except for the status, it does show the server is running. But otherwise, all I see is that it just goes to a new line with no confirmation or errors.
Jason L. Amerson
-----Original Message-----
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Thursday, November 21, 2019 04:53 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
On 11/21/19 1:14 PM, Jason L. Amerson wrote:
> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>
> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>
Additional questions that came to mind:
1) How are you starting/stopping server?
2) What do you see on the terminal when you restart the server? I see:
aklaver@ranger:~> sudo /etc/init.d/postgresql11 restart Restarting PostgreSQL: ok
aklaver@ranger:~> -2019-11-21 13:49:30.104 PST-0LOG: listening on IPv6 address "::1", port 5432
-2019-11-21 13:49:30.104 PST-0LOG: listening on IPv4 address
"127.0.0.1", port 5432
-2019-11-21 13:49:30.193 PST-0LOG: listening on Unix socket
"/tmp/.s.PGSQL.5432"
-2019-11-21 13:49:30.322 PST-0LOG: redirecting log output to logging
collector process
-2019-11-21 13:49:30.322 PST-0HINT: Future log output will appear in
directory "log".
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:53 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:49 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-22 15:56 ` Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 0 replies; 37+ messages in thread
From: Adrian Klaver @ 2019-11-22 15:56 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: PostgreSQL <pgsql-general@lists.postgresql.org>
On 11/22/19 5:49 AM, Jason L. Amerson wrote:
> I am start/stopping the server by using sudo service postgresql start/stop/restart/status. When I run any of these commands, I do not get anything. No confirmation, except for
Where did the postgresql file in /etc/init.d/ come from?
Does it have something like:
# Setting environment variables for the postmaster here does not work;
please
# set them in /etc/postgresql/<version>/<cluster>/environment instead.
[ -r /usr/share/postgresql-common/init.d-functions ] || exit 0
. /usr/share/postgresql-common/init.d-functions
near the top?
the status, it does show the server is running. But otherwise, all I see
is that it just goes to a new line with no confirmation or errors.
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Adrian Klaver <adrian.klaver@aklaver.com>
> Sent: Thursday, November 21, 2019 04:53 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> On 11/21/19 1:14 PM, Jason L. Amerson wrote:
>> 1) I have attached a screenshot of the output of "ps ax | grep post" on the Ubuntu machine.
>>
>> 2) Since I was new to PostgreSQL, I followed a tutorial online. I did install from source which I already knew how to do. I got the source package from PostgreSQL. I basically followed these instructions:
>>
>
> Additional questions that came to mind:
>
> 1) How are you starting/stopping server?
>
> 2) What do you see on the terminal when you restart the server? I see:
>
> aklaver@ranger:~> sudo /etc/init.d/postgresql11 restart Restarting PostgreSQL: ok
>
>
>
> aklaver@ranger:~> -2019-11-21 13:49:30.104 PST-0LOG: listening on IPv6 address "::1", port 5432
>
>
> -2019-11-21 13:49:30.104 PST-0LOG: listening on IPv4 address
> "127.0.0.1", port 5432
>
>
> -2019-11-21 13:49:30.193 PST-0LOG: listening on Unix socket
> "/tmp/.s.PGSQL.5432"
>
>
> -2019-11-21 13:49:30.322 PST-0LOG: redirecting log output to logging
> collector process
>
>
> -2019-11-21 13:49:30.322 PST-0HINT: Future log output will appear in
> directory "log".
>
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 20:16 ` Andrew Kerber <andrew.kerber@gmail.com>
1 sibling, 0 replies; 37+ messages in thread
From: Andrew Kerber @ 2019-11-21 20:16 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Steve Crawford <scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
Is your hosts file configured correctly? Is there an entry for the IP
address you are using in your hosts file? And does it point to the correct
hostname and ip address?
On Thu, Nov 21, 2019 at 2:07 PM Jason L. Amerson <drjason@alphagenius.org>
wrote:
> pg_settings show localhost.
>
> Jason L. Amerson
>
>
> -----Original Message-----
> From: Tom Lane <tgl@sss.pgh.pa.us>
> Sent: Thursday, November 21, 2019 02:42 PM
> To: Jason L. Amerson <drjason@alphagenius.org>
> Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
> <adrian.klaver@aklaver.com>; 'PostgreSQL'
> <pgsql-general@lists.postgresql.org>
> Subject: Re: Remote Connection Help
>
> "Jason L. Amerson" <drjason@alphagenius.org> writes:
> > Yes "listen_addresses" is not commented. I did notice when I did the
> netstat, for tcp, it was all "127.0.0.1" on various ports including 5432
> but
> I have a listing for tcp6 that has my static IP using port 32305. Would
> that
> make a difference?
>
> Hm, well, *something* is overriding the setting. What did you find in
> pg_settings?
>
> regards, tom lane
>
>
>
>
>
>
--
Andrew W. Kerber
'If at first you dont succeed, dont take up skydiving.'
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 20:31 ` Tom Lane <tgl@sss.pgh.pa.us>
3 siblings, 0 replies; 37+ messages in thread
From: Tom Lane @ 2019-11-21 20:31 UTC (permalink / raw)
To: Jason L. Amerson <drjason@alphagenius.org>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> pg_settings show localhost.
What I asked you about was the "source" columns.
regards, tom lane
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 20:52 ` Jason L. Amerson <drjason@alphagenius.org>
3 siblings, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 20:52 UTC (permalink / raw)
To: PostgreSQL <pgsql-general@lists.postgresql.org>
I have attached a screenshot of the output.
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Thursday, November 21, 2019 03:32 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver'
<adrian.klaver@aklaver.com>; 'PostgreSQL'
<pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
"Jason L. Amerson" <drjason@alphagenius.org> writes:
> pg_settings show localhost.
What I asked you about was the "source" columns.
regards, tom lane
Attachments:
pg_settings.jpg (image/jpeg, 810.4K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* RE: Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Re: Remote Connection Help Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Re: Remote Connection Help Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` RE: Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Re: Remote Connection Help Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-11-21 21:05 ` Jason L. Amerson <drjason@alphagenius.org>
3 siblings, 0 replies; 37+ messages in thread
From: Jason L. Amerson @ 2019-11-21 21:05 UTC (permalink / raw)
To: 'Andrew Kerber' <andrew.kerber@gmail.com>; +Cc: 'Steve Crawford' <scrawford@pinpointresearch.com>; 'Adrian Klaver' <adrian.klaver@aklaver.com>; 'PostgreSQL' <pgsql-general@lists.postgresql.org>
I have attached a screenshot of my hosts file. My static IP is not listed in the file. The second line where it has “thuban”, Thuban is my machine’s name.
Jason L. Amerson
From: Andrew Kerber <andrew.kerber@gmail.com>
Sent: Thursday, November 21, 2019 03:17 PM
To: Jason L. Amerson <drjason@alphagenius.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>; Steve Crawford <scrawford@pinpointresearch.com>; Adrian Klaver <adrian.klaver@aklaver.com>; PostgreSQL <pgsql-general@lists.postgresql.org>
Subject: Re: Remote Connection Help
Is your hosts file configured correctly? Is there an entry for the IP address you are using in your hosts file? And does it point to the correct hostname and ip address?
On Thu, Nov 21, 2019 at 2:07 PM Jason L. Amerson <drjason@alphagenius.org <mailto:drjason@alphagenius.org> > wrote:
pg_settings show localhost.
Jason L. Amerson
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us> >
Sent: Thursday, November 21, 2019 02:42 PM
To: Jason L. Amerson <drjason@alphagenius.org <mailto:drjason@alphagenius.org> >
Cc: 'Steve Crawford' <scrawford@pinpointresearch.com <mailto:scrawford@pinpointresearch.com> >; 'Adrian Klaver'
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com> >; 'PostgreSQL'
<pgsql-general@lists.postgresql.org <mailto:pgsql-general@lists.postgresql.org> >
Subject: Re: Remote Connection Help
"Jason L. Amerson" <drjason@alphagenius.org <mailto:drjason@alphagenius.org> > writes:
> Yes "listen_addresses" is not commented. I did notice when I did the
netstat, for tcp, it was all "127.0.0.1" on various ports including 5432 but
I have a listing for tcp6 that has my static IP using port 32305. Would that
make a difference?
Hm, well, *something* is overriding the setting. What did you find in
pg_settings?
regards, tom lane
--
Andrew W. Kerber
'If at first you dont succeed, dont take up skydiving.'
Attachments:
Hosts_File.jpg (image/jpeg, 575.4K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: [SPAM] Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
@ 2019-11-21 16:27 ` Moreno Andreo <moreno.andreo@evolu-s.it>
2019-11-21 21:40 ` Re: [SPAM] Remote Connection Help Peter J. Holzer <hjp-pgsql@hjp.at>
2 siblings, 1 reply; 37+ messages in thread
From: Moreno Andreo @ 2019-11-21 16:27 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
This is a multi-part message in MIME format.
--------------8A17E94AA27BB2A9CF0AC373
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: 8bit
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Il 21/11/19 15:21, Jason L. Amerson ha
scritto:<br>
</div>
<blockquote type="cite"
cite="mid:!&!AAAAAAAAAAAuAAAAAAAAAGmIF169jV1Ig2e+e0GOo%2FYBAMO2jhD3dRHOtM0AqgC7tuYAAAAAAA4AABAAAAAse4DPB0qGQZhIy%2FhSwvrXAQAAAAA=@alphagenius.org">
<meta name="Microsoft Theme 2.00" content="axis 111">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Verdana",sans-serif;
color:black;}
h1
{mso-style-priority:9;
mso-style-link:"Heading 1 Char";
margin-top:12.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:16.0pt;
font-family:"Verdana",sans-serif;
color:black;}
h2
{mso-style-priority:9;
mso-style-link:"Heading 2 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Verdana",sans-serif;
color:black;
font-weight:normal;}
h3
{mso-style-priority:9;
mso-style-link:"Heading 3 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Verdana",sans-serif;
color:black;
font-weight:normal;}
h4
{mso-style-priority:9;
mso-style-link:"Heading 4 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:14.0pt;
font-family:"Verdana",sans-serif;
color:black;
font-weight:normal;}
h5
{mso-style-priority:9;
mso-style-link:"Heading 5 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:13.0pt;
font-family:"Verdana",sans-serif;
color:black;
font-weight:normal;}
h6
{mso-style-priority:9;
mso-style-link:"Heading 6 Char";
margin-top:2.0pt;
margin-right:0in;
margin-bottom:0in;
margin-left:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:11.0pt;
font-family:"Verdana",sans-serif;
color:black;
font-weight:normal;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#00CC00;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#996666;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
color:black;}
span.Heading1Char
{mso-style-name:"Heading 1 Char";
mso-style-priority:9;
mso-style-link:"Heading 1";
font-family:"Verdana",sans-serif;
color:black;
font-weight:bold;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-priority:9;
mso-style-link:"Heading 2";
font-family:"Verdana",sans-serif;
color:black;}
span.Heading3Char
{mso-style-name:"Heading 3 Char";
mso-style-priority:9;
mso-style-link:"Heading 3";
font-family:"Verdana",sans-serif;
color:black;}
span.Heading4Char
{mso-style-name:"Heading 4 Char";
mso-style-priority:9;
mso-style-link:"Heading 4";
font-family:"Verdana",sans-serif;
color:black;}
span.Heading5Char
{mso-style-name:"Heading 5 Char";
mso-style-priority:9;
mso-style-link:"Heading 5";
font-family:"Verdana",sans-serif;
color:black;}
span.Heading6Char
{mso-style-name:"Heading 6 Char";
mso-style-priority:9;
mso-style-link:"Heading 6";
font-family:"Verdana",sans-serif;
color:black;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><img
src="cid:part1.02521655.8F185B9A@evolu-s.it"
v:src="mailbox:///C:/Users/moreno/AppData/Roaming/Thunderbird/Profiles/tafa2k1y.default/Mail/evolu-s.it/Inbox.sbd/pgsql-general?number=29543&header=quotebody&part=1.2&filename=image001.gif"
v:shapes="_x0000_Mail" class="shape"
style="display:none;width:0;height:0" width="0" height="0"><!--[if gte mso 9]><xml>
<v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="1024,768">
<v:fill src="mailbox:///C:/Users/moreno/AppData/Roaming/Thunderbird/Profiles/tafa2k1y.default/Mail/evolu-s.it/Inbox.sbd/pgsql-general?number=29543&header=quotebody&part=1.2&filename=image001.gif" o:title="axibkgnd" type="frame" />
</v:background></xml><![endif]-->
<div class="WordSection1"><span
style="font-family:"Arial",sans-serif"><o:p> </o:p></span>
<p class="MsoNormal" style="margin-left:35.45pt"><span
style="font-family:"Arial",sans-serif">could not
connect to server: Connection refused (Ox0000274D/10061) Is
the server running on host " xx.xx.xx.xx" and accepting <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:35.45pt"><span
style="font-family:"Arial",sans-serif">TCP/IP
connections on port 5432'<o:p></o:p></span></p>
<br>
</div>
</blockquote>
Connection refused means somthing has blocked it. If it was all OK
and simply Postgres was not listening, you should've received a
"connection timed out"(10060) message.<br>
Have you tried adjusting/tearing off iptables and check what
happens, as also Ekaterina pointed out?<br>
<br>
And, just as a side note, I normally don't activate IPv6 if it's not
necessary (it has not been necessary in the last 10 years :-) ),
'cause I've run in some troubles that have been cleared getting rid
of IPv6)<br>
so I'll try editing postgresql.conf as<br>
listen = '127.0.0.1'<br>
<br>
HTH,<br>
Moreno.-<br>
</body>
</html>
--------------8A17E94AA27BB2A9CF0AC373
Content-Type: image/gif;
name="image001.gif"
Content-Transfer-Encoding: base64
Content-ID: <part1.02521655.8F185B9A@evolu-s.it>
Content-Disposition: inline;
filename="image001.gif"
R0lGODlhZABkAPcAAJkAM/8zZswAM/8AM/+ZmcwzZv/M/8xmmZkzZmYAM8wzmf+ZzP9mzP+Z
//9mmcwAZv8AZv8zmf8Amf8zzP8AzP9m//8z//9QUNYAk5kAZsxmzMwzzMyZ/8xm/8wz/5kz
mcwAzMwA/5kAzJkAmcyZzJlmmWYzZmYAmZkzzGYAZpkA/5kz/5lmzDMAM2YzmWYzzGYAzJlm
/zMAZmYA/2Yz/8zM/5mZ/5mZzGZmzGZm/2ZmmTMzZjMzmTMAmTMAzDMAzDMz/zMzzABm/wAz
zDNm/zNmzAAAZgAAMwAA/wAAmQAzzAAAzDNmmQBmzJnM/2aZ/wAzZmaZzABmmTOZzACZzGbM
/zOZ/wAzmQCZ/zPM/wDM/5n//2b//wAzMwD//wDMzACZmWaZmZnMzMz//zPMzGbMzDOZmTNm
ZgBmZgAzMwD/zDP/zDPMmQDMmWb/zJn/zAD/mTOZZgBmMzNmM2aZZmbMZpn/mWb/ZjOZM5nM
mWb/mTP/mTPMZgDMZmbMmQCZZgCZMzP/ZgD/Zsz/zMz/mZn/Zpn/MwDMMzP/MwDMMzPMMzPM
M2b/M2bMMwBmAAAzAACZADPMAGb/AJn/AGbMAADMADPMADOZAJnMZmaZM5nMMzNmAGaZAJnM
AMz/Zsz/M8z/AJmZAMzMAMzMMzMzAGZmAJmZM8zMZmZmM5mZZszMmf//zP//mf//Zv//M///
AP/MAP/MZv/MM8yZM5lmAMyZAP+ZAMxmAJkzAMxmM2YzAP+ZZv9mM/+ZM/9mAMwzAJlmMzMA
AGYzM5lmZsyZmZkzM8xmZv/MzP8zM8wzM/9mZmYAAJkAAMwAAP8AAP8zAMyZZv/MmczMzJmZ
mWZmZjMzMwAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAZABkAAAI/wCvCRxIsKDBgwgTKlzIsKHD
hwNVQZwYkeJEVRIRZoS40aLHjwalgRxJsqTJkwU7olzJMqHKljBjypw58yVKmzQX4tSZ8+PO
nkCDCh1KFOTPoiOPIl3KtGJMpTVPQhWqUmRTolMPWr3KFWbWlV+7ih1LtmxKpGHJbnWYFuVa
owbbmp3r0ifdqHcfys3b8C1fthf/ajS5d6/gw0MNI26ZVfHioI4fS55MmXHly4T1Yt4MODDn
hh39No382SNpvqdLq+a4+hpOnKJbd5Y9+Whq2qpvJ/6rm2LvoqR/O70r/HFxhbFxJxSt+7Vy
y8+lRp8O9Dj16wKtl9aO/eZh7t0FJkIPXxY8+fPmz2tWP7p3evZkv76Hnz3p3Pn08+tH7xm6
RfwHWQcgW+CNx5WB+wFH3GgJNtjXVQM6uJqAmKUWIU8aBQQAOw==
--------------8A17E94AA27BB2A9CF0AC373--
Attachments:
image001.gif (image/gif, 1.1K) download
view image
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: [SPAM] Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:27 ` Re: [SPAM] Remote Connection Help Moreno Andreo <moreno.andreo@evolu-s.it>
@ 2019-11-21 21:40 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2019-11-22 13:13 ` Re: [SPAM] Remote Connection Help Moreno Andreo <moreno.andreo@evolu-s.it>
0 siblings, 1 reply; 37+ messages in thread
From: Peter J. Holzer @ 2019-11-21 21:40 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
On 2019-11-21 17:27:04 +0100, Moreno Andreo wrote:
> Connection refused means somthing has blocked it. If it was all OK and simply
> Postgres was not listening, you should've received a "connection timed out"
> (10060) message.
Almost exactly the other way around. If you try to connect to a port
where no server is listening, you get a connection refused message.
If something is blocking the connection you may get a timeout.
hp
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
^ permalink raw reply [nested|flat] 37+ messages in thread
* Re: [SPAM] Remote Connection Help
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:27 ` Re: [SPAM] Remote Connection Help Moreno Andreo <moreno.andreo@evolu-s.it>
2019-11-21 21:40 ` Re: [SPAM] Remote Connection Help Peter J. Holzer <hjp-pgsql@hjp.at>
@ 2019-11-22 13:13 ` Moreno Andreo <moreno.andreo@evolu-s.it>
0 siblings, 0 replies; 37+ messages in thread
From: Moreno Andreo @ 2019-11-22 13:13 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org
Il 21/11/19 22:40, Peter J. Holzer ha scritto:
> On 2019-11-21 17:27:04 +0100, Moreno Andreo wrote:
>> Connection refused means somthing has blocked it. If it was all OK and simply
>> Postgres was not listening, you should've received a "connection timed out"
>> (10060) message.
> Almost exactly the other way around. If you try to connect to a port
> where no server is listening, you get a connection refused message.
> If something is blocking the connection you may get a timeout.
>
> hp
>
O.O
You're right, obviously. Don't know why, it's since school days that
sometines I swap these 2 error meanings (and have to deal with the
consequences)...
But I'm confident that one day there will be no more swapping...
hopefully until I retire ...:-)
Thanks for pointing out and sorry for the mistake
(blushing)
Moreno.-
^ permalink raw reply [nested|flat] 37+ messages in thread
end of thread, other threads:[~2019-11-23 18:20 UTC | newest]
Thread overview: 37+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 14:21 Remote Connection Help Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 14:30 ` Ekaterina Amez <ekaterina.amez@zunibal.com>
2019-11-21 14:48 ` Steve Atkins <steve@blighty.com>
2019-11-21 15:35 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 15:15 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 16:47 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 17:05 ` Steve Crawford <scrawford@pinpointresearch.com>
2019-11-21 17:44 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 18:18 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 18:40 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:02 ` Mark Johnson <remi9898@gmail.com>
2019-11-21 19:43 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:53 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 19:56 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 19:41 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:07 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 20:16 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 21:14 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:22 ` Andrew Kerber <andrew.kerber@gmail.com>
2019-11-21 21:32 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:40 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 14:56 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 16:27 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 18:10 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-23 17:03 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-23 18:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 21:53 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-22 13:49 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-22 15:56 ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-21 20:16 ` Andrew Kerber <andrew.kerber@gmail.com>
2019-11-21 20:31 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-11-21 20:52 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 21:05 ` Jason L. Amerson <drjason@alphagenius.org>
2019-11-21 16:27 ` Moreno Andreo <moreno.andreo@evolu-s.it>
2019-11-21 21:40 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2019-11-22 13:13 ` Moreno Andreo <moreno.andreo@evolu-s.it>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox