Re: BUG #16531: listen_addresses wide open?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bee(dot)lists(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16531: listen_addresses wide open?
Date: 2020-07-08 16:24:45
Message-ID: 1715900.1594225485@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I only had this in postgresql.conf:
> listen_adresses = '192.168.1.50'

Just to be sure, "show listen_addresses" actually shows that,
and not something else?

> The machine was properly functioning on 'localhost' in an application I had
> on the same machine.

When I set the server's listen_addresses to just the machine's TCP
address, trying to connect to "localhost" gives me what I'd expect:

$ psql -h localhost -l
psql: error: could not connect to server: could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

That's entirely independent of what's in pg_hba.conf: there's simply
no open socket on localhost.

So basically, it works for me, and you haven't shown what sort of
configuration problem is making it not work for you.

It could be that there's something odd about the way "localhost"
resolves on your machine; you could check "dig localhost." to be
sure. But probably a more likely theory is that you didn't make
the listen_addresses setting take effect (you need to restart the
postmaster to change that). Or possibly you've got more than one
postmaster active on the machine, and the other one is answering
localhost?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Soumyadeep Chakraborty 2020-07-08 16:52:31 Re: posgres 12 bug (partitioned table)
Previous Message Thompson, Shon 2020-07-08 15:25:18 RE: <EXTERNAL> Re: Invalid memory alloc querying field type bytea