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.