Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zlp2S-0004ok-DC for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2015 02:10:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zlp2R-0002h7-BI for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Oct 2015 02:10:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zlp17-00019J-Dy for pgsql-hackers@postgresql.org; Tue, 13 Oct 2015 02:08:41 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zlp13-0007lc-Ri for pgsql-hackers@postgresql.org; Tue, 13 Oct 2015 02:08:40 +0000 Received: by pacex6 with SMTP id ex6so4850933pac.3 for ; Mon, 12 Oct 2015 19:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xxW4OaQgpesKmFCiqz4KHkrFJGhMiT+c1fVs6f3wy/s=; b=NonNXrSC+DmQ38SQPNpHyer3uJXxwZrTv9MVGMKULiqXsN3bYV40Ghdodp+qGCRrGQ mBGdi+ZsIOkNYmh6YPcfD2EdE/hJN08xAN/M5f8EGrDEtPjqtua7i3CjLvhFxWOZS7jA LoD3osqLYfDMvGadMdpEowteq0WlTfDu7WISw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=xxW4OaQgpesKmFCiqz4KHkrFJGhMiT+c1fVs6f3wy/s=; b=OClzcLMUTm5gv2nV+7WvsqfTAObeTM+vx8w8o7s/YB4hm79geiT/IYM0r2D/RKeD92 fsFWZsnUi8F56ddSyfRr3zuIZiYHX/JMib8t0BB4L7KJ1O1Fwskm5CbnGwWHckeN5KWd sk0V78q3/LgtXFIljflq7pDXFTBXTy+FmDOylktM2uUiVHLorLrdtlkTqRFKwuVCcWt4 n0pqsKLeuKT+pA1bmx6FbcDw62KaqkyqcG9XVNxG8vUMukMXoIOJ0mC25gAuR584jPJE 05lzx6O0yiRyzb4OOp5OXWuW3Mr5LA2GKJ1D3W1anusLH+LWL5z1vnBxcdU7jznwJ2tv 5tNA== X-Gm-Message-State: ALoCoQmQSQD8zRCNn8TBAl2NXvLioi8wUeBO0Yb/KiNPK+WCYxIiS9ngHI06yYb2SUpWcjYTBZM2 X-Received: by 10.68.220.166 with SMTP id px6mr36964789pbc.99.1444702114291; Mon, 12 Oct 2015 19:08:34 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id nu5sm440012pbb.65.2015.10.12.19.08.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 12 Oct 2015 19:08:33 -0700 (PDT) Date: Mon, 12 Oct 2015 22:08:31 -0400 From: Noah Misch To: Tom Lane Cc: Robert Haas , Tatsuo Ishii , kondo@sraoss.co.jp, "pgsql-hackers@postgresql.org" Subject: Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::') Message-ID: <20151013020831.GC164717@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> <20151010021651.GA85148@tornado.leadboat.com> <1815.1444694857@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1815.1444694857@sss.pgh.pa.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Mon, Oct 12, 2015 at 08:07:37PM -0400, Tom Lane wrote: > Robert Haas writes: > > On Fri, Oct 9, 2015 at 10:16 PM, Noah Misch wrote: > >> 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. > > I do *not* buy that we can safely replace "localhost" by "127.0.0.1". Nobody proposed that. The word "localhost" did not appear in this thread. > Consider a system that's only set up with IPv6 local addressing. > > AFAICS the complaint in this bug is about a system with broken DNS (ie, > unable to resolve "localhost" properly, which is something mandated by > relevant RFCs, I believe). 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. A patch that changes the 0.0.0.0 case in this way should also change PQping("host='::'") to PQping("host='::1'"); I suspect that was implicit in the original proposal. nm -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers