When reporting the server as not responding, if the hostname was
Bruce Momjian <bruce@momjian.us>
When reporting the server as not responding, if the hostname was supplied, also print the IP address. This allows IPv4 and IPv6 failures to be distinguished. Also useful when a hostname resolves to multiple IP addresses. Also, remove use of inet_ntoa() and use our own inet_net_ntop() in all places, including in libpq, because it is thread-safe.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/libpq.sgml | modified | +2 −2 |
| src/backend/utils/adt/inet_cidr_ntop.c (from src/backend/utils/adt/inet_net_ntop.c) | renamed | +0 −235 |
| src/backend/utils/adt/Makefile | modified | +1 −1 |
| src/include/port.h | modified | +4 −0 |
| src/include/utils/builtins.h | modified | +1 −3 |
| src/interfaces/libpq/fe-connect.c | modified | +24 −1 |
| src/port/getaddrinfo.c | modified | +5 −7 |
| src/port/inet_net_ntop.c | added | +275 −0 |
| src/port/Makefile | modified | +1 −1 |