postgresql/src/interfaces
Peter Eisentraut 1944cdc982 libpq: PQhost to return active connected host or hostaddr
Previously, PQhost didn't return the connected host details when the
connection type was CHT_HOST_ADDRESS (i.e., via hostaddr).  Instead, it
returned the complete host connection parameter (which could contain
multiple hosts) or the default host details, which was confusing and
arguably incorrect.

Change this to return the actually connected host or hostaddr
irrespective of the connection type.  When hostaddr but no host was
specified, hostaddr is now returned.  Never return the original host
connection parameter, and document that PQhost cannot be relied on
before the connection is established.

PQport is similarly changed to always return the active connection port
and never the original connection parameter.

Author: Hari Babu <kommi.haribabu@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
2018-03-27 12:32:18 -04:00
..
ecpg Fix make rules that generate multiple output files. 2018-03-23 13:46:00 -04:00
libpq libpq: PQhost to return active connected host or hostaddr 2018-03-27 12:32:18 -04:00
Makefile Fix parallel make when running make install before make all 2011-03-08 23:52:29 +02:00