Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

From: Noah Misch <noah(at)leadboat(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: robertmhaas(at)gmail(dot)com, kondo(at)sraoss(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Date: 2015-10-23 00:51:47
Message-ID: 20151023005147.GA403745@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thu, Oct 22, 2015 at 04:15:10PM -0700, Tom Lane wrote:
> Tatsuo Ishii <ishii(at)postgresql(dot)org> writes:
> >> The original post used only "0.0.0.0" and "::", not "localhost" or anything
> >> else entailing name resolution. As I wrote above, Kondo proposed for pg_ctl
> >> to use PQping("host='127.0.0.1'") in place of PQping("host='0.0.0.0'").
> >> That's all. pg_ctl would continue to use PQping("host='localhost'") where
> >> it's doing so today.
> >
> > Does anybody already write a patch in this direction or willing to do
> > it? If not, I (or kondo) would like to write the patch.

I have not; please do.

> AFAICS, the only hard-wired hostname reference in pg_ctl is "localhost",
> not "127.0.0.1" (much less "0.0.0.0"). So what you're proposing doesn't
> seem to me to have anything to do with what's there. I continue to think
> that the OP's complaint is somehow founded on a bad address obtained by
> looking up "localhost", because where else would it've come from?

pg_ctl reads the address from postmaster.pid, which in turn derives from
listen_addresses:

$ grep -E '(unix|listen)' postgresql.conf
listen_addresses = '0.0.0.0'
unix_socket_directories = ''
$ strace -e connect pg_ctl -D . -w start
--- SIGCHLD (Child exited) @ 0 (0) ---
waiting for server to start...connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
connect(3, {sa_family=AF_INET, sin_port=htons(6432), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EINPROGRESS (Operation now in progress)
403978 2015-10-23 00:45:06.677 GMT LOG: redirecting log output to logging collector process
403978 2015-10-23 00:45:06.677 GMT HINT: Future log output will appear in directory "..".
done
server started
Process 403975 detached

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2015-10-23 00:56:33 Re: [BUGS] BUG #13702: pg_dump interprets “=” in a db name incorrectly
Previous Message felipe 2015-10-23 00:34:45 BUG #13702: pg_dump interprets “=” in a db name incorrectly

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-10-23 00:59:25 Re: COPY FREEZE and PD_ALL_VISIBLE
Previous Message Andres Freund 2015-10-23 00:09:43 Re: Making tab-complete.c easier to maintain