Hello,
I've found a bug that psql's \conninfo displays incorrect information on
Windows. Please find attached the patch and commit this.
[Problem]
When I run "psql postgres" on Windows and execute \conninfo, it outputs the
text below. It reports that psql connected to the server via UNIX domain
socket, but the actual connection is of course via TCP/IP socket to
localhost.
You are connected to database "postgres" as user "Administrator" via socket
in "/tmp" at port "5432".
It should output:
You are connected to database "postgres" as user "Administrator" on host
"localhost" at port "5432".
[Cause]
\conninfo calls PQhost(conn) to get the destination info. PQhost() in this
case returns NULL because conn->pghost and conn->pghostaddr are NULL. When
\conninfo receives NULL from PQhost(), it assumes /tmp.
[Fix]
PQhost() should return the actual destination.
Regards
MauMau