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: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tatsuo Ishii <ishii(at)postgresql(dot)org>, kondo(at)sraoss(dot)co(dot)jp, "pgsql-hackers(at)postgresql(dot)org" <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-12 23:51:16
Message-ID: 20151012235116.GA164717@tornado.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Oct 12, 2015 at 07:37:42PM -0400, Robert Haas wrote:
> On Fri, Oct 9, 2015 at 10:16 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> > On Fri, Oct 09, 2015 at 03:14:26PM -0400, Robert Haas wrote:
> >> On Thu, Oct 8, 2015 at 11:26 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> >> >> In particular, magically
> >> >> substituting 127.0.0.1 for 0.0.0.0 seems utterly without principle.
> >> >
> >> > Binding a listening socket to "0.0.0.0" listens on every local IPv4 address,
> >> > and 127.0.0.1 is one of those addresses. That's the principle. It's
> >> > inelegant, but I expect it to work everywhere.
> >>
> >> But... what about the machine's other addresses?
> >>
> >> If Windows doesn't treat 0.0.0.0 to mean listen on every interface,
> >> that's a shame. But making it only listen on 127.0.0.1 and not any of
> >> the others does not seem better. Then, instead of 0.0.0.0 failing on
> >> Windows, it would instead work but with different behavior. That
> >> doesn't seem good either.
> >
> > The listening side is in good shape today. This thread is about the address
> > that pg_ctl uses in PQping("host=..."). Listening on 0.0.0.0 is portable.
> > PQping("host='0.0.0.0'") relies on non-portable semantics in the underlying
> > connect() syscall. PQping("host='127.0.0.1'") is a portable substitute.
>
> Ah. So in this case 0.0.0.0 is interpreted to mean "any IP that's a
> way to reach the local host", and using 127.0.0.1 makes sense because
> we know that will always be one of them? I could buy that line of
> reasoning.

Exactly.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-10-13 00:07:37 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Previous Message Robert Haas 2015-10-12 23:37:42 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-10-12 23:54:30 Re: More work on SortSupport for text - strcoll() and strxfrm() caching
Previous Message Robert Haas 2015-10-12 23:37:42 Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')