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 20180104130525.GD5470@paquier.xyz
Whole thread Raw
In response to Re: Enhance pg_stat_wal_receiver view to display connected host  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Enhance pg_stat_wal_receiver view to display connected host
List pgsql-hackers
On Thu, Jan 04, 2018 at 08:54:37AM -0300, Alvaro Herrera wrote:
> I think more attention should be given to the libpq side of this patch;
> maybe have a 0001 with only the new libpq function, to easily verify
> that it does all it needs to do.  It needs docs for the new function in
> libpq.sgml; also I wonder if checking conn->status before reporting
> values is necessary; finally, has the application any good way to check
> that the values can be safely read after calling the new function?

Or instead of reinventing again the wheel, why not removing
remote_hostaddr, and fetch the wanted values from PQhost() and PQport()
after making sure that the connection status is good? There is no need
for a new API this way. And as bonus points, we can also rely on
defaults.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Next
From: Emre Hasegeli
Date:
Subject: Re: [HACKERS] [PATCH] Improve geometric types