Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpQbv-00027k-TI for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 00:53:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZpQbu-0001gI-GB for pgsql-hackers@arkaria.postgresql.org; Fri, 23 Oct 2015 00:53:34 +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 1ZpQab-0000CG-3q for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 00:52:13 +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 1ZpQaT-0005vx-Ku for pgsql-hackers@postgresql.org; Fri, 23 Oct 2015 00:52:11 +0000 Received: by pabrc13 with SMTP id rc13so101041693pab.0 for ; Thu, 22 Oct 2015 17:52:02 -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=lzy64GjktuB2Sp0RsWm6UMCnSY4GbgTwpseHyDaBn/A=; b=TbbZSxnFrRBL52S8DeeSzZWCzNU+HAkJclFeI7fDbNzF2MRXtLWf6JeVjim7Fme/u0 w5ul7Mz52vcpAnk77EIJKI54hOp9k2GXkgo3QxBnveAuWOnQAWfXZDMAZtj7McE9TNJ4 Uguds3ps1+k57TE1YLC1cETwkc7SMqnKilCOE= 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=lzy64GjktuB2Sp0RsWm6UMCnSY4GbgTwpseHyDaBn/A=; b=anwVkIlDN3HlduPDXSBTo89eQRcpSqKSVHGRHJnQGG48M4uScSoBEPT1XkCbA9uPhJ YxYnKEtUgkcVKsDxtyQyizba1L0I1JMQsZtzUJQ0PnujZfONoUrJ5fkJIkwPm5LY/IqU 6qL/FuBHEjqFgZjWftJLlhWUCPPCgOantAuy+s9P8QpYXfHhPvmb0nSca5RuUtKTkn6G BjlNblOQ+z4lORdrycuUDaSt/homN4Rd6c5Jv7rd2DkYZmOSQOC818pRuPcKNqmnZb+u aAbnjprCwsaWBsksdrtY5P/hv6UdubTYaDhpPKvCgGYfmswT5d1at6WhrD42zOpXn8oN iT/w== X-Gm-Message-State: ALoCoQmYkruXkWtJ60b2Ancw6s56lvMOoJuV0oe771qWg9ECdpDt1y7HGXE5NlXRLrxpypEUbJvF X-Received: by 10.66.221.6 with SMTP id qa6mr1410581pac.9.1445561522691; Thu, 22 Oct 2015 17:52:02 -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 an5sm15837176pbd.45.2015.10.22.17.52.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Oct 2015 17:52:02 -0700 (PDT) Date: Thu, 22 Oct 2015 20:51:47 -0400 From: Noah Misch To: Tatsuo Ishii , Tom Lane Cc: 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: <20151023005147.GA403745@tornado.leadboat.com> References: <1815.1444694857@sss.pgh.pa.us> <20151013020831.GC164717@tornado.leadboat.com> <20151023.080042.393745468058207046.t-ishii@sraoss.co.jp> <53500.1445555710@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53500.1445555710@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 Thu, Oct 22, 2015 at 04:15:10PM -0700, Tom Lane wrote: > Tatsuo Ishii 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers