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

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Noah Misch <noah@leadboat.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>, Arthur Zakirov <a.zakirov@postgrespro.ru>, Robert Haas <robertmhaas@gmail.com>
Date: 2019-06-12T08:24:31Z
Lists: pgsql-hackers
Hello Noah,

>>>> Although I guess it can be avoided by `-reuse-previous=off`, probably it
>>>> makese sense to update the docs.
>>>
>>> Yep, that is one option. The other is to revert or alter the subtle
>>> change, but ISTM that it made sense in some use case, so I wanted some
>>> time to think about it and test.
>>
>> Sure, no one argue that the behaviour should be changed, it's only about the
>> documentation part.
>
> No, I was arguing that a behavior should revert back its v11 behavior:

I got that. I'm working on it, and on the other issues you raised.

The issue I see is what do we want when a name resolves to multiple 
addresses. The answer is not fully obvious to me right now. I'll try to 
send a patch over the week-end.

> \connect mydb myuser myhost
> -- should resolve "myhost" again, like it did in v11
> \connect
>
> \connect "dbname=mydb host=myhost hostaddr=127.0.0.1"
> -- ok to reuse hostaddr=127.0.0.1; I agree that's a feature
> \connect

-- 
Fabien.



Commits

  1. Tweak libpq's PQhost, PQhostaddr, and psql's \connect

  2. psql: Show IP address in \conninfo