Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-11-08 Thread Noah Misch
On Thu, Oct 29, 2015 at 05:39:36PM +0900, Tatsuo Ishii wrote: > > I am happy to finish it, but I am no less happy if you finish it. Which do > > you prefer? > > Please go ahead and commit. > > > Should the back-branch commits mirror the master branch? A more-cautious > > alternative would be

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-29 Thread Tatsuo Ishii
> 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 >> >

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-28 Thread Noah Misch
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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-27 Thread Tatsuo Ishii
Noah, > 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 >

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-27 Thread Tatsuo Ishii
Noah, > 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 >

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-27 Thread Noah Misch
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 */ > +

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-25 Thread Tatsuo Ishii
> As I stated upthread, PQping("host='0.0.0.0'") is _not portable_. It works on > GNU/Linux, which I used for that demo. It fails on OpenBSD and Windows. > >> I'd be inclined to suggest fixing it like this: >> >> /* If postmaster is listening on "*", use localhost >>

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-24 Thread Peter Eisentraut
On 10/23/15 11:10 PM, Noah Misch wrote: > On RHEL 5 and some other "active adult" systems, "localhost" does not reach a > listen_addresses='::' server. IPv6 is available, but "localhost" resolves to > 127.0.0.1 only. > > The latest systems resolve "localhost" to both 127.0.0.1 and ::1, in which

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-23 Thread Noah Misch
On Thu, Oct 22, 2015 at 07:59:27PM -0700, Tom Lane wrote: > Noah Misch writes: > > 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' > >

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Tom Lane
Andres Freund writes: > Perhaps we should start to emit a notice at startup if localhost doesn't > resolve to either v4 or v6 definitions. The few environments where > that's indeed intentionally not the case, should be fine with such a > message at pgstat startup. I think

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Tom Lane
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.

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Noah Misch
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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Tatsuo Ishii
> 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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Andres Freund
On 2015-10-22 16:15:10 -0700, Tom Lane wrote: > 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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-22 Thread Tom Lane
Noah Misch writes: > On Thu, Oct 22, 2015 at 04:15:10PM -0700, Tom Lane wrote: >> 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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-12 Thread Noah Misch
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

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-12 Thread Noah Misch
On Mon, Oct 12, 2015 at 07:37:42PM -0400, Robert Haas wrote: > On Fri, Oct 9, 2015 at 10:16 PM, Noah Misch wrote: > > On Fri, Oct 09, 2015 at 03:14:26PM -0400, Robert Haas wrote: > >> On Thu, Oct 8, 2015 at 11:26 PM, Noah Misch wrote: > >> >> In particular,

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-12 Thread Robert Haas
On Fri, Oct 9, 2015 at 10:16 PM, Noah Misch wrote: > On Fri, Oct 09, 2015 at 03:14:26PM -0400, Robert Haas wrote: >> On Thu, Oct 8, 2015 at 11:26 PM, Noah Misch wrote: >> >> In particular, magically >> >> substituting 127.0.0.1 for 0.0.0.0 seems utterly

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-12 Thread Tom Lane
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. >>

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-09 Thread Noah Misch
On Fri, Oct 09, 2015 at 03:14:26PM -0400, Robert Haas wrote: > On Thu, Oct 8, 2015 at 11:26 PM, Noah Misch wrote: > >> In particular, magically > >> substituting 127.0.0.1 for 0.0.0.0 seems utterly without principle. > > > > Binding a listening socket to "0.0.0.0" listens on

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-10-09 Thread Robert Haas
On Thu, Oct 8, 2015 at 11:26 PM, Noah Misch wrote: >> In particular, magically >> substituting 127.0.0.1 for 0.0.0.0 seems utterly without principle. > > Binding a listening socket to "0.0.0.0" listens on every local IPv4 address, > and 127.0.0.1 is one of those addresses.

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-09-13 Thread Tom Lane
Tatsuo Ishii writes: >> When pg_ctl tries to connect to postmaster, it uses "0.0.0.0" as the >> target ip address. Unfortunately "0.0.0.0" is not a valid address on >> Windows and it fails. Shouldn't pg_ctl translate "0.0.0.0" to >> "127.0.0.1" in this case? > I think this

Re: [HACKERS] Re: [BUGS] BUG #13611: test_postmaster_connection failed (Windows, listen_addresses = '0.0.0.0' or '::')

2015-09-13 Thread Tatsuo Ishii
> Tatsuo Ishii writes: >>> When pg_ctl tries to connect to postmaster, it uses "0.0.0.0" as the >>> target ip address. Unfortunately "0.0.0.0" is not a valid address on >>> Windows and it fails. Shouldn't pg_ctl translate "0.0.0.0" to >>> "127.0.0.1" in this case? > >> I