pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Tatsuo Ishii <ishii@postgresql.org>
Cc: kondo@sraoss.co.jp, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Subject: Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Date: Mon, 12 Oct 2015 19:51:16 -0400
Message-ID: <20151012235116.GA164717@tornado.leadboat.com> (raw)
In-Reply-To: <CA+TgmobJ2ntJ8qU69LdemHhSKtC+8cMOVc5Wncmd1DdXbjLOGw@mail.gmail.com>
References: <20150910041518.635.87615@wrigleys.postgresql.org>
	<20150914.131534.102176843624802952.t-ishii@sraoss.co.jp>
	<11077.1442205374@sss.pgh.pa.us>
	<20151009032649.GA62964@tornado.leadboat.com>
	<CA+TgmoYfnf=pQKBa5khLf9RH_SkmMEn2miqmoJ-GTXeHNcVULg@mail.gmail.com>
	<20151010021651.GA85148@tornado.leadboat.com>
	<CA+TgmobJ2ntJ8qU69LdemHhSKtC+8cMOVc5Wncmd1DdXbjLOGw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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@leadboat.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@leadboat.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.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (26+ messages)  latest in thread

Message-ID: <20151012235116.GA164717@tornado.leadboat.com>
Permalink:  ../20151012235116.GA164717@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20151012235116.GA164717@tornado.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noah@leadboat.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, ishii@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
  In-Reply-To: <20151012235116.GA164717@tornado.leadboat.com>
  References: <20150910041518.635.87615@wrigleys.postgresql.org> <20150914.131534.102176843624802952.t-ishii@sraoss.co.jp> <11077.1442205374@sss.pgh.pa.us> <20151009032649.GA62964@tornado.leadboat.com> <CA+TgmoYfnf=pQKBa5khLf9RH_SkmMEn2miqmoJ-GTXeHNcVULg@mail.gmail.com> <20151010021651.GA85148@tornado.leadboat.com> <CA+TgmobJ2ntJ8qU69LdemHhSKtC+8cMOVc5Wncmd1DdXbjLOGw@mail.gmail.com> <20151012235116.GA164717@tornado.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox