[bug fix] psql's \conninfo reports incorrect destination on Windows

Поиск
Список
Период
Сортировка
От MauMau
Тема [bug fix] psql's \conninfo reports incorrect destination on Windows
Дата
Msg-id 8913B51B3B534F878D54B89E1EB964C6@maumau
обсуждение исходный текст
Ответы Re: [bug fix] psql's \conninfo reports incorrect destination on Windows  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Metin Doslu
Дата:
Сообщение: Re: Parallel Select query performance and shared buffers
Следующее
От: Metin Doslu
Дата:
Сообщение: Re: [PERFORM] Parallel Select query performance and shared buffers