Re: Enhance pg_stat_wal_receiver view to display connected host
Haribabu Kommi <kommi.haribabu@gmail.com>
From: Haribabu Kommi <kommi.haribabu@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Michael Paquier <michael.paquier@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2018-03-28T04:41:33Z
Lists: pgsql-hackers
Attachments
- pg_stat_wal_receiver-to-display-remote-server-info_v3.patch (application/octet-stream) patch v3
On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier <michael@paquier.xyz>
wrote:
> On Wed, Mar 28, 2018 at 11:28:32AM +1100, Haribabu Kommi wrote:
> > I updated the pg_stat_wal_receiver patch with the new PQhost() function
> > behavior and updated the view with two columns, (remote_server and
> > remote_port) instead of three as earlier.
> >
> > Updated patch attached.
>
> Thanks Hari for the updated patch. I was looking forward to seeing a
> ner version.
>
Thanks for the review.
>
> +/*
> + * Provides remote sever info.
> + */
> Typo here. This could be more precise, like "Provides information of
> remote server this WAL receiver is connected to".
>
updated as above.
+libpqrcv_get_remoteserver_info(WalReceiverConn *conn, char
> **remote_server,
> + int *remote_port)
> +{
> + char *ret = NULL;
> +
> + Assert(conn->streamConn != NULL);
>
> Okay. The connection should be established so normally the results from
> PQport and PQhost should not be NULL. Still I agree that this feels
> safer for the long term.
>
OK.
Updated patch attached.
Regards,
Hari Babu
Fujitsu Australia
Commits
-
Enhance pg_stat_wal_receiver view to display host and port of sender server.
- 9a895462d940 11.0 landed
-
Allow multiple hostaddrs to go with multiple hostnames.
- 7b02ba62e9ff 10.0 cited
-
libpq: Fix inadvertent change in PQhost() behavior.
- 11003eb55658 10.0 cited
-
libpq: Allow connection strings and URIs to specify multiple hosts.
- 274bb2b3857c 10.0 cited