From: Noah Misch <noah@leadboat.com>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: tgl@sss.pgh.pa.us
Cc: robertmhaas@gmail.com
Cc: kondo@sraoss.co.jp
Cc: pgsql-hackers@postgresql.org
Subject: Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
Date: Tue, 27 Oct 2015 03:20:24 -0400
Message-ID: <20151027072024.GA683077@tornado.leadboat.com> (raw)
In-Reply-To: <20151026.095403.804552198762060224.t-ishii@sraoss.co.jp>
References: <20151023005147.GA403745@tornado.leadboat.com>
<55164.1445569167@sss.pgh.pa.us>
<20151024031036.GB421105@tornado.leadboat.com>
<20151026.095403.804552198762060224.t-ishii@sraoss.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Mon, Oct 26, 2015 at 09:54:03AM +0900, Tatsuo Ishii wrote:
> > Kondo's design is correct.
>
> So more proper fix looks like this?
> + /* If postmaster is listening on "*", "0.0.0.0" or "::", use 127.0.0.1 */
> + if (strcmp(host_str, "*") == 0 ||
> + strcmp(host_str, "0.0.0.0") == 0 ||
> + strcmp(host_str, "::") == 0)
> + strcpy(host_str, "127.0.0.1");
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:
inline patch 1: src/bin/pg_ctl/pg_ctl.c (+5/-1 lines) download inline-1.patch--- 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");
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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, ishii@postgresql.org, tgl@sss.pgh.pa.us, robertmhaas@gmail.com, kondo@sraoss.co.jp, pgsql-hackers@postgresql.org
Subject: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
In-Reply-To: <20151027072024.GA683077@tornado.leadboat.com>
References: <20151023005147.GA403745@tornado.leadboat.com> <55164.1445569167@sss.pgh.pa.us> <20151024031036.GB421105@tornado.leadboat.com> <20151026.095403.804552198762060224.t-ishii@sraoss.co.jp> <20151027072024.GA683077@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