Re: fix psql \conninfo & \connect when using hostaddr - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: fix psql \conninfo & \connect when using hostaddr
Date
Msg-id alpine.DEB.2.21.1906132140090.10845@lancre
Whole thread Raw
In response to Re: fix psql \conninfo & \connect when using hostaddr  (Noah Misch <noah@leadboat.com>)
Responses Re: fix psql \conninfo & \connect when using hostaddr
List 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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: REINDEX locking
Next
From: Peter Geoghegan
Date:
Subject: Re: REINDEX locking