Re: List of hostaddrs not supported

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Arthur Zakirov <a.zakirov@postgrespro.ru>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>, Mithun Cy <mithun.cy@enterprisedb.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-07-10T12:32:37Z
Lists: pgsql-hackers
On 07/10/2017 01:47 PM, Arthur Zakirov wrote:
> Hello,
>
> 2017-07-10 12:30 GMT+03:00 Heikki Linnakangas <hlinnaka@iki.fi>:
>>
>>
>> I just remembered that this was still pending. I made the documentation
>> changes, and committed this patch now.
>>
>> We're uncomfortably close to wrapping the next beta, later today, but I
>> think it's better to get this into the hands of people testing this, rather
>> than wait for the next beta. I think the risk of breaking something that
>> used to work is small.
>>
> I get this warning during compilation using gcc 7.1.1 20170621:
>
>> fe-connect.c:1100:61: warning: comparison between pointer and zero
> character constant [-Wpointer-compare]
>>     conn->connhost[i].host != NULL && conn->connhost[i].host != '\0')

Thanks, fixed! That check for empty hostname was indeed wrong.

- Heikki



Commits

  1. Fix check for empty hostname.

  2. Allow multiple hostaddrs to go with multiple hostnames.

  3. Silence warning about uninitialized 'ret' variable on some compilers.

  4. Give a better error message on invalid hostaddr option.