Enhance pg_stat_wal_receiver view to display connected host

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Enhance pg_stat_wal_receiver view to display connected host
Date: 2017-12-21 11:16:06
Message-ID: CAJrrPGcV_aq8=cdqkFhVDJKEnDQ70yRTTdY9RODzMnXNrCz2Ow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
pg_stat_wal_receiver-to-display-connected-host.patch application/octet-stream 11.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2017-12-21 11:17:50 Re: [HACKERS] path toward faster partition pruning
Previous Message Andres Freund 2017-12-21 11:00:48 condition variable cleanup and subtransactions