Re: Enhance pg_stat_wal_receiver view to display connected host - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Enhance pg_stat_wal_receiver view to display connected host
Date
Msg-id 20180112050641.GH2222@paquier.xyz
Whole thread Raw
In response to Re: Enhance pg_stat_wal_receiver view to display connected host  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: Enhance pg_stat_wal_receiver view to display connected host
List pgsql-hackers
On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote:
> Before posting the patch, first I did the same, upon further study
> I didn't find any scenario where the value is not present in
> conn->connhost[conn->whichhost].host and present in conn->pghost.
>
> If user provides "host" as connection option, the value is present
> in both the variables. Even if the connection is unix domain socket,
> there is a value in conn->connhost[conn->whichhost].host.
>
> In case if user provides only hostaddr and host connection option,
> then in that case, both the members are NULL. So even if we add
> that case, it will be dead code.

Hm. Wouldn't it matter for cases where caller has not yet established a
connection to the server but still calls PQhost to get the host string?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: Enhance pg_stat_wal_receiver view to display connected host
Next
From: Haribabu Kommi
Date:
Subject: Re: Enhance pg_stat_wal_receiver view to display connected host