Re: BUG #16531: listen_addresses wide open? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16531: listen_addresses wide open?
Date
Msg-id 1715900.1594225485@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16531: listen_addresses wide open?  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.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



pgsql-bugs by date:

Previous
From: "Thompson, Shon"
Date:
Subject: RE: Re: Invalid memory alloc querying field type bytea
Next
From: Soumyadeep Chakraborty
Date:
Subject: Re: posgres 12 bug (partitioned table)