Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')
От | Noah Misch |
---|---|
Тема | Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::') |
Дата | |
Msg-id | 20151027072024.GA683077@tornado.leadboat.com обсуждение исходный текст |
Ответ на | Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::') (Tatsuo Ishii <ishii@postgresql.org>) |
Ответы |
Re: Re: [BUGS] BUG #13611: test_postmaster_connection
failed (Windows, listen_addresses = '0.0.0.0' or '::')
Re: Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::') |
Список | pgsql-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: --- 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");
В списке pgsql-hackers по дате отправления: