Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-28 Thread Kyotaro HORIGUCHI
At Wed, 28 Mar 2018 10:34:49 +0900, Michael Paquier wrote in <20180328013449.gc1...@paquier.xyz> > On Wed, Mar 28, 2018 at 11:06:23AM +1100, Haribabu Kommi wrote: > > On Wed, Mar 28, 2018 at 3:35 AM, Peter Eisentraut < > > peter.eisentr...@2ndquadrant.com> wrote: > >> > >>

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Michael Paquier
On Wed, Mar 28, 2018 at 11:06:23AM +1100, Haribabu Kommi wrote: > On Wed, Mar 28, 2018 at 3:35 AM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: >> >> Committed after fixing up the documentation a bit as suggested by others. > > Thanks. +1. Thanks for working on this Hari, Peter

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Haribabu Kommi
On Wed, Mar 28, 2018 at 3:35 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/27/18 02:20, Michael Paquier wrote: > > On Tue, Mar 27, 2018 at 04:47:41PM +1100, Haribabu Kommi wrote: > >> updated patch attached with additional doc updates as per the suggestion > >> from the

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Peter Eisentraut
On 3/27/18 02:20, Michael Paquier wrote: > On Tue, Mar 27, 2018 at 04:47:41PM +1100, Haribabu Kommi wrote: >> updated patch attached with additional doc updates as per the suggestion >> from the upthreads. > > Thanks Hari for the quick update. It looks to me that this is shaped as > suggested.

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Kyotaro HORIGUCHI
I apologize in advance that I'm not proper for wordsmithing. At Tue, 27 Mar 2018 00:24:07 -0700, "David G. Johnston" wrote in > On Mon, Mar 26, 2018 at 10:47 PM, Haribabu Kommi

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread David G. Johnston
On Mon, Mar 26, 2018 at 10:47 PM, Haribabu Kommi wrote: > updated patch attached with additional doc updates as per the suggestion > from the upthreads. > ​- Some comments if the patch remains in-tact: ​

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Michael Paquier
On Tue, Mar 27, 2018 at 04:47:41PM +1100, Haribabu Kommi wrote: > updated patch attached with additional doc updates as per the suggestion > from the upthreads. Thanks Hari for the quick update. It looks to me that this is shaped as suggested. Any input from other folks? I don't have more to

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Haribabu Kommi
On Tue, Mar 27, 2018 at 3:03 PM, David G. Johnston < david.g.johns...@gmail.com> wrote: > On Mon, Mar 26, 2018 at 8:24 PM, Michael Paquier > wrote: > >> On Tue, Mar 27, 2018 at 11:43:27AM +1100, Haribabu Kommi wrote: >> > Patch attached with the above behavior along with

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread David G. Johnston
On Mon, Mar 26, 2018 at 8:24 PM, Michael Paquier wrote: > On Tue, Mar 27, 2018 at 11:43:27AM +1100, Haribabu Kommi wrote: > > Patch attached with the above behavior along with other comments from > > upthread. > > Thanks for the updated version. > > The function changes look

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Michael Paquier
On Tue, Mar 27, 2018 at 11:43:27AM +1100, Haribabu Kommi wrote: > Patch attached with the above behavior along with other comments from > upthread. Thanks for the updated version. The function changes look logically good to me. + + The PQhost function returns NULL when the +

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Haribabu Kommi
On Tue, Mar 27, 2018 at 12:23 AM, Michael Paquier wrote: > On Mon, Mar 26, 2018 at 11:39:51PM +1100, Haribabu Kommi wrote: > > And if we are not going to change the above, then PQhost() function > > returns 3 values, > > - NULL when the conn==NULL > > - Actual host or

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Michael Paquier
On Mon, Mar 26, 2018 at 11:39:51PM +1100, Haribabu Kommi wrote: > And if we are not going to change the above, then PQhost() function > returns 3 values, > - NULL when the conn==NULL > - Actual host or hostaddr of the active connection > - Empty string when the conn is not able to evaluate. > >

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Haribabu Kommi
On Mon, Mar 26, 2018 at 6:34 PM, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello. > > At Mon, 26 Mar 2018 17:49:22 +1100, Haribabu Kommi < > kommi.harib...@gmail.com> wrote in sgsfmjgvberjh0n9w8ry24...@mail.gmail.com> > > Thanks for the review.

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Kyotaro HORIGUCHI
Hello. At Mon, 26 Mar 2018 17:49:22 +1100, Haribabu Kommi wrote in > On Mon, Mar 26, 2018 at 4:17 PM, Michael Paquier > wrote: > > > On Mon, Mar 26, 2018 at 11:28:41AM +0900,

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Haribabu Kommi
On Mon, Mar 26, 2018 at 4:17 PM, Michael Paquier wrote: > On Mon, Mar 26, 2018 at 11:28:41AM +0900, Kyotaro HORIGUCHI wrote: > > At Sun, 25 Mar 2018 22:27:09 +1100, Haribabu Kommi < > kommi.harib...@gmail.com> wrote in

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-25 Thread Michael Paquier
On Mon, Mar 26, 2018 at 11:28:41AM +0900, Kyotaro HORIGUCHI wrote: > At Sun, 25 Mar 2018 22:27:09 +1100, Haribabu Kommi > wrote in

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-25 Thread Kyotaro HORIGUCHI
At Sun, 25 Mar 2018 22:27:09 +1100, Haribabu Kommi wrote in

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-25 Thread Haribabu Kommi
On Sun, Mar 25, 2018 at 12:56 AM, Michael Paquier wrote: > On Sat, Mar 24, 2018 at 01:49:28AM +1100, Haribabu Kommi wrote: > > Here I attached the updated patch that returns either the connected > > host/hostaddr > > or NULL in case if the connection is not established. > >

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-24 Thread Michael Paquier
On Sat, Mar 24, 2018 at 01:49:28AM +1100, Haribabu Kommi wrote: > Here I attached the updated patch that returns either the connected > host/hostaddr > or NULL in case if the connection is not established. > > I removed the returning default host details, because the default host > details are

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-23 Thread Haribabu Kommi
On Thu, Mar 22, 2018 at 12:28 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/21/18 03:40, Michael Paquier wrote: > >>> Moreover, I wonder whether we shouldn't remove the branch where > >>> conn->connhost is NULL. When would that be the case? The current > >>> behavior is

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-21 Thread Peter Eisentraut
On 3/21/18 03:40, Michael Paquier wrote: >>> Moreover, I wonder whether we shouldn't remove the branch where >>> conn->connhost is NULL. When would that be the case? The current >>> behavior is to sometimes return the actual host connected to, and >>> sometimes the host list. That doesn't make

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-21 Thread Michael Paquier
On Wed, Mar 21, 2018 at 10:33:19AM +1100, Haribabu Kommi wrote: > On Wed, Mar 21, 2018 at 6:06 AM, Peter Eisentraut < > peter.eisentr...@2ndquadrant.com> wrote: > >> On 3/16/18 00:03, Kyotaro HORIGUCHI wrote: >>> I agree to the conclusion that PQhost() shouldn't return hostaddr >>> "if it has any

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-20 Thread Haribabu Kommi
On Wed, Mar 21, 2018 at 6:06 AM, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 3/16/18 00:03, Kyotaro HORIGUCHI wrote: > > I agree to the conclusion that PQhost() shouldn't return hostaddr > > "if it has any host name to return". But I still haven't found > > the reason for

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-20 Thread Peter Eisentraut
On 3/16/18 00:03, Kyotaro HORIGUCHI wrote: > I agree to the conclusion that PQhost() shouldn't return hostaddr > "if it has any host name to return". But I still haven't found > the reason for returning '/tmp' for IP connection. > > The attached patch is revised version of that in the following

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-15 Thread Kyotaro HORIGUCHI
At Fri, 16 Mar 2018 09:50:41 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180316.095041.241173653.horiguchi.kyot...@lab.ntt.co.jp> > I drifted to come here.. > > At Wed, 14 Mar 2018 11:17:35 +0900, Michael Paquier > wrote in

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-15 Thread Kyotaro HORIGUCHI
I drifted to come here.. At Wed, 14 Mar 2018 11:17:35 +0900, Michael Paquier wrote in <20180314021735.gi1...@paquier.xyz> > On Fri, Mar 09, 2018 at 04:42:30PM -0500, Peter Eisentraut wrote: > > It seems, however, that PGhost() has always been broken for hostaddr > > use.

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-13 Thread Michael Paquier
On Fri, Mar 09, 2018 at 04:42:30PM -0500, Peter Eisentraut wrote: > It seems, however, that PGhost() has always been broken for hostaddr > use. In 9.6 (before the multiple-hosts stuff was introduced), when > connecting to "hostaddr=127.0.0.1", PGhost() returns "/tmp". Urgh. > > I think we

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-09 Thread Peter Eisentraut
On 1/13/18 22:19, Haribabu Kommi wrote: > While working on [1], we find out the inconsistency in PQHost() behavior > if the connecting string that is passed to connect to the server contains > multiple hosts with both host and hostaddr types. For example, > > host=host1,host2

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-02-05 Thread Haribabu Kommi
On Sun, Jan 14, 2018 at 9:44 PM, Michael Paquier wrote: > On Sun, Jan 14, 2018 at 02:19:26PM +1100, Haribabu Kommi wrote: > > While working on [1], we find out the inconsistency in PQHost() behavior > > if the connecting string that is passed to connect to the server

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-01-14 Thread Michael Paquier
On Sun, Jan 14, 2018 at 02:19:26PM +1100, Haribabu Kommi wrote: > While working on [1], we find out the inconsistency in PQHost() behavior > if the connecting string that is passed to connect to the server contains > multiple hosts with both host and hostaddr types. For example, > >