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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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: 2019-06-13 20:09:59
Message-ID: alpine.DEB.2.21.1906132140090.10845@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Noah,

>> there is no simple way to know whether hostaddr was set at
>> the libPQ level
>
>> A solution could be to have a PQdoestheconnectionuseshostaddr(conn)
>> function, but I cannot say I'd be thrilled.
>
> PQconninfo() is the official way to retrieve that.

Thanks for the pointer! I did not notice this one. At least the API looks
better than the one I was suggesting:-)

ISTM that this function could be used to set other parameters, fixing some
other issues such as ignoring special parameters on reconnections.

Anyway, attached an attempt at implementing the desired behavior wrt
hostaddr.

--
Fabien.

Attachment Content-Type Size
connect-fix-2.patch text/x-diff 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2019-06-13 20:10:11 Re: REINDEX locking
Previous Message Robert Haas 2019-06-13 20:04:19 REINDEX locking