Re: fix psql \conninfo & \connect when using hostaddr

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: fix psql \conninfo & \connect when using hostaddr
Date: 2018-11-19 19:43:12
Message-ID: alpine.DEB.2.21.1811192036380.4640@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Alvaro,

>> - libpq internal function getHostaddr get a length,
>> and I added an assert about it.
>> - added a few braces on if/if/else/if/else/else
>> - added an UNKNOWN_HOST macro to hide "???"
>> - moved host_addr[] declaration earlier to avoid some braces
>
> You forgot to free(conn->connip) during freePGconn().

Argh, indeed:-(

> I found the UNKNOWN_HOST business quite dubious -- not only in your
> patch but also in the existing coding.

So did I:-) I only kept it because it was already done like that.

> I changed the getHostname API so that instead of returning "???" it sets
> the output buffer to the empty string.

I hesitated to do exactly that. I'm fine with that.

Thanks for the push.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2018-11-19 19:54:49 Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Alvaro Herrera 2018-11-19 18:54:31 Re: [HACKERS] generated columns