From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com> |
Cc: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
Subject: | Re: Enhance pg_stat_wal_receiver view to display connected host |
Date: | 2018-03-28 01:54:46 |
Message-ID: | 20180328015446.GD1105@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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.
+/*
+ * Provides remote sever info.
+ */
Typo here. This could be more precise, like "Provides information of
remote server this WAL receiver is connected to".
+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.
Except for the small typo outlined, the rest of the patch lokks fine to
me. Most of the work has really happened for PQhost..
--
Michael
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2018-03-28 02:06:26 | Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation() |
Previous Message | Michael Paquier | 2018-03-28 01:34:49 | Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types |