Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zre2L-0006S6-BV for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 03:38:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zre2J-00015r-M5 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Oct 2015 03:37:59 +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 1Zre2H-00014D-Ia for pgsql-hackers@postgresql.org; Thu, 29 Oct 2015 03:37:57 +0000 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Zre2D-0004GJ-Fy for pgsql-hackers@postgresql.org; Thu, 29 Oct 2015 03:37:56 +0000 Received: by pasz6 with SMTP id z6so26526829pas.2 for ; Wed, 28 Oct 2015 20:37:51 -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=/lcj3bKTGwYi893GyLbPC0xSrd0POKH8JpTWqEgGX6c=; b=SYw4VrjTnO+TeLVqndSrhXgoHuWBAvUboUTAnyJHtgOuh7Pe+6nu8xIA01fhO+XokH n3sL075qpVWVtM5XTnAXjQHw4PcWhoZuuYR6w1hxsSzouIHwFySeMQEaKBw4At95fhxi SCCFUclmqcdUBKYp9omZVk0R6aPGMA8g/JsiI= 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=/lcj3bKTGwYi893GyLbPC0xSrd0POKH8JpTWqEgGX6c=; b=e5D4lgtRyDJmaU5P5kvpNeaN3GkzsE/ialmLCTk4QGqqW3uD75T1ubWq+vaSQ9WUkb o+h9pNZNTsz3CqU8A0/T6qC47sjzUI/NU8FQqyK1PdfSkxGVvX0hfPGy9g+ysCP9qEtc GusCXz5Z2brmWvTB+Ll9QJix6MZTWtcMGiYrcehD7VTwgp3MBeKjzJPbBQKJShksvD++ N9oNZMwasdxgSp1qaCXHWebgxWT+Jrlz78N0GlopbjPrrd+QDFU8fJ67HayGLBckSlCV tGZ+aOmO04kWLiFlmup6awEyYhxoQA3uwxLBImz1i4tIScBp7f6Ur49XXaIxHfosjgVf LBpQ== X-Gm-Message-State: ALoCoQm7RgZNC8X5wYEc6Riivu3imD3o4HUrMQGOyBZOzQrzW5zIHiZslJuudOFPBJ8n7oeiov06 X-Received: by 10.68.69.45 with SMTP id b13mr57208123pbu.67.1446089871159; Wed, 28 Oct 2015 20:37:51 -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 so4sm48093798pbc.72.2015.10.28.20.37.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 28 Oct 2015 20:37:50 -0700 (PDT) Date: Wed, 28 Oct 2015 23:37:48 -0400 From: Noah Misch To: Tatsuo Ishii Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, 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: <20151029033748.GB770464@tornado.leadboat.com> References: <20151024031036.GB421105@tornado.leadboat.com> <20151026.095403.804552198762060224.t-ishii@sraoss.co.jp> <20151027072024.GA683077@tornado.leadboat.com> <20151027.173125.434122070202062022.t-ishii@sraoss.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151027.173125.434122070202062022.t-ishii@sraoss.co.jp> 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 Tue, Oct 27, 2015 at 05:31:25PM +0900, Tatsuo Ishii wrote: > > No, PQping("host='127.0.0.1'") fails to reach a listen_addresses='::' server > > on many systems. Here's what I thought Kondo was proposing: > > > > --- a/src/bin/pg_ctl/pg_ctl.c > > +++ b/src/bin/pg_ctl/pg_ctl.c > > @@ -649,5 +649,9 @@ test_postmaster_connection(pgpid_t pm_pid, bool do_checkpoint) > > > > - /* If postmaster is listening on "*", use localhost */ > > + /* explanation here */ > > if (strcmp(host_str, "*") == 0) > > strcpy(host_str, "localhost"); > > + else if (strcmp(host_str, "0.0.0.0") == 0) > > + strcpy(host_str, "127.0.0.1"); > > + else if (strcmp(host_str, "::") == 0) > > + strcpy(host_str, "::1"); > > > > I see. Would you like to commit this? I am happy to finish it, but I am no less happy if you finish it. Which do you prefer? Should the back-branch commits mirror the master branch? A more-cautious alternative would be to, in back branches, wrap the change in #ifdefs so it takes effect only on Windows, OpenBSD and NetBSD. It could break setups with local firewall rules that block connections to "127.0.0.1" or "::1" without blocking "0.0.0.0" or "::". Such firewall rules sound outlandish enough that I would be fairly comfortable not worrying about this and making the change unconditional in all branches. It's a judgment call, though. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers