Thread: BUG #16017: Postgres does not respond non-local connections

BUG #16017: Postgres does not respond non-local connections

From
PG Bug reporting form
Date:
The following bug has been logged on the website:

Bug reference:      16017
Logged by:          DBurca
Email address:      davidburcaa@gmail.com
PostgreSQL version: 11.0
Operating system:   Windows OS
Description:

First thing's first, I actually have 2 versions of Postgres on my computer
(9.4 and 11) because when I check the task manager, postgresql-x64-11 is
stopped and refuses to be started, however, when I run pgAdmin 4, I can
connect to the servers and query stuff into them. I decided to try an
experiment and see if I could connect another device (RaspberryPi running
Raspbian (based on Debian Linux)) to the server on the Windows OS (Note that
I have already looked through the pg_hba.conf.sample and the
postgres.conf.sample (I'm not exactly sure why they're named .sample, Ill
just leave is as-is for now) and changed the settings so that they would
accept non-local connections. But when I try to connect from the RaspberryPi
, it says "psql: could not connect to server: connection timed out". I look
through the log files on the Windows OS device's log files, and as you can
imagine, it sees nothing wrong with this. (Note that both devices are
running on the same wifi connection) I have explored every nook and cranny,
including shutting off my firewall to see if that was the problem, and I
still get no answer. Is there something that I am missing? (More information
can be found at my stack overflow question:
https://stackoverflow.com/questions/58019474/connection-to-external-postgres-database-times-out)
Thanks in advance!


Re: BUG #16017: Postgres does not respond non-local connections

From
Francisco Olarte
Date:
David:

On Sun, Sep 22, 2019 at 3:55 PM PG Bug reporting form
<noreply@postgresql.org> wrote:
> I have already looked through the pg_hba.conf.sample and the
> postgres.conf.sample (I'm not exactly sure why they're named .sample, Ill
> just leave is as-is for now) and changed the settings so that they would
> accept non-local connections. But when I try to connect from the RaspberryPi

They are named .sample because they are samples of something you could
put on the real files ( without the .sample ). Do you have those
right?


Francisco Olarte.



Re: BUG #16017: Postgres does not respond non-local connections

From
Andrew Gierth
Date:
>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG> (Note that I have already looked through the pg_hba.conf.sample and
 PG> the postgres.conf.sample (I'm not exactly sure why they're named
 PG> .sample, Ill just leave is as-is for now) and changed the settings
 PG> so that they would accept non-local connections.

The .sample files are badly named. They aren't samples, and you're not
expected to edit them (though you can if you know what you're doing);
what they really are is _templates_, which initdb uses to create the
real postgresql.conf and pg_hba.conf files. Nothing reads them except
initdb.

To actually enable remote connections, you need to edit the
listen_addresses setting in postgresql.conf (not .sample) for the
running server and restart it. Connecting locally and doing
"SHOW config_file;" should tell you where to find it.

-- 
Andrew (irc:RhodiumToad)