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

From Haribabu Kommi
Subject Enhance pg_stat_wal_receiver view to display connected host
Date
Msg-id CAJrrPGcV_aq8=cdqkFhVDJKEnDQ70yRTTdY9RODzMnXNrCz2Ow@mail.gmail.com
Whole thread Raw
Responses Re: Enhance pg_stat_wal_receiver view to display connected host  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
Hi Hackers,

With the multi host connection string feature, it is possible to specify multiple
hosts in primary_conninfo that is used in streaming replication to make sure
that WAL streaming is not affected.

Currently there is no information that is available in the standby node to find out
to which primary currently it is connected. Need to find out from primary node only.

I feel it may be better if we can enhance the pg_stat_wal_receiver to display the
connected host information such as "hostname", "hostaddr" and "port". So that
it is possible to find out the from standby node to which primary currently it is
connected.

The current connected host details are already available in the PGconn structure,
Exposing those details in the view will suffice this requirement. Currently these
members are characters pointers, I used them as it is and displayed them in the
view as character arrays except the port number.

Attached the draft patch. Any comments?

Regards,
Hari Babu
Fujitsu Australia
Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: condition variable cleanup and subtransactions
Next
From: David Rowley
Date:
Subject: Re: [HACKERS] path toward faster partition pruning