Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-30 Thread Fujii Masao
On Fri, Mar 30, 2018 at 9:34 AM, Michael Paquier wrote: > On Fri, Mar 30, 2018 at 10:52:02AM +1100, Haribabu Kommi wrote: >> On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: >>> @@ -753,4 +753,6 @@ CREATE VIEW pg_stat_wal_receiver AS >>>

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Michael Paquier
On Fri, Mar 30, 2018 at 10:52:02AM +1100, Haribabu Kommi wrote: > On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: >> @@ -753,4 +753,6 @@ CREATE VIEW pg_stat_wal_receiver AS >> s.latest_end_time, >> s.slot_name, >> +s.remote_server,

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Haribabu Kommi
On Fri, Mar 30, 2018 at 7:26 AM, Fujii Masao wrote: > On Wed, Mar 28, 2018 at 3:09 PM, Michael Paquier > wrote: > > On Wed, Mar 28, 2018 at 03:41:33PM +1100, Haribabu Kommi wrote: > >> On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-29 Thread Fujii Masao
On Wed, Mar 28, 2018 at 3:09 PM, Michael Paquier wrote: > On Wed, Mar 28, 2018 at 03:41:33PM +1100, Haribabu Kommi wrote: >> On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier >> wrote: >> Updated patch attached. Thanks for the patch! I'd like to commit

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-28 Thread Michael Paquier
On Wed, Mar 28, 2018 at 03:41:33PM +1100, Haribabu Kommi wrote: > On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier > wrote: > Updated patch attached. Thanks, switched as ready for committer. -- Michael signature.asc Description: PGP signature

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-27 Thread Haribabu Kommi
On Wed, Mar 28, 2018 at 12:54 PM, Michael Paquier 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 > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-27 Thread Michael Paquier
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

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-03-27 Thread Haribabu Kommi
On Tue, Jan 30, 2018 at 4:02 PM, Michael Paquier wrote: > On Tue, Jan 30, 2018 at 03:10:12PM +1100, Haribabu Kommi wrote: > > Ok, understood. As the libpq gives preference to hostaddr connection > > parameter than host while connecting. How about going with one column

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-29 Thread Michael Paquier
On Tue, Jan 30, 2018 at 03:10:12PM +1100, Haribabu Kommi wrote: > Ok, understood. As the libpq gives preference to hostaddr connection > parameter than host while connecting. How about going with one column > "remote_host" that displays either hostaddr(if exists) or hostname. So that > one column

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-29 Thread Haribabu Kommi
On Mon, Jan 29, 2018 at 7:06 PM, Michael Paquier wrote: > On Tue, Jan 16, 2018 at 05:56:22PM +1100, Haribabu Kommi wrote: > > Without PQhostaddr() function, for the connections where the host is not > > specified, it will be difficult to find out to remote server. > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-29 Thread Michael Paquier
On Tue, Jan 16, 2018 at 05:56:22PM +1100, Haribabu Kommi wrote: > Without PQhostaddr() function, for the connections where the host is not > specified, it will be difficult to find out to remote server. That's true as well, but hostaddr should be used with host only to save IP lookups... There

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-22 Thread Haribabu Kommi
On Tue, Jan 16, 2018 at 5:56 PM, Haribabu Kommi wrote: > > On Tue, Jan 16, 2018 at 2:55 PM, Michael Paquier < > michael.paqu...@gmail.com> wrote: > >> >> Note that I still find this API confusing, it seems to me that just >> sorting out the confusion problems with

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-15 Thread Haribabu Kommi
[ Including Hackers as earlier mail mistakenly removed it ] On Tue, Jan 16, 2018 at 2:55 PM, Michael Paquier wrote: > On Mon, Jan 15, 2018 at 05:51:58PM +1100, Haribabu Kommi wrote: > > Instead of effective_conninfo, I changed the column name as > > remote_serve_info

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-12 Thread Michael Paquier
On Fri, Jan 12, 2018 at 04:32:54PM +1100, Haribabu Kommi wrote: > On Fri, Jan 12, 2018 at 4:06 PM, Michael Paquier > wrote: > > On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote: > > > Before posting the patch, first I did the same, upon further study > > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Haribabu Kommi
On Fri, Jan 12, 2018 at 4:06 PM, Michael Paquier wrote: > On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote: > > Before posting the patch, first I did the same, upon further study > > I didn't find any scenario where the value is not present in > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 03:55:04PM +1100, Haribabu Kommi wrote: > Before posting the patch, first I did the same, upon further study > I didn't find any scenario where the value is not present in > conn->connhost[conn->whichhost].host and present in conn->pghost. > > If user provides "host" as

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Haribabu Kommi
On Fri, Jan 12, 2018 at 3:26 PM, Michael Paquier wrote: > On Fri, Jan 12, 2018 at 11:37:22AM +0900, Michael Paquier wrote: > > I have redone my set of previous tests and can confirm that PQhost is > > behaving as I would expect it should, and those results are the same

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Fri, Jan 12, 2018 at 11:37:22AM +0900, Michael Paquier wrote: > I have redone my set of previous tests and can confirm that PQhost is > behaving as I would expect it should, and those results are the same as > yours. if (conn->connhost != NULL && -

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-11 Thread Michael Paquier
On Wed, Jan 10, 2018 at 04:10:35PM +1100, Haribabu Kommi wrote: > On Tue, Jan 9, 2018 at 12:15 PM, Michael Paquier > wrote: >> Hm. Any users of psql's PROMPT would be equally confused, and this can >> actually lead to more confusion from the user prospective I think

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-09 Thread Haribabu Kommi
On Tue, Jan 9, 2018 at 12:15 PM, Michael Paquier wrote: > On Fri, Jan 05, 2018 at 09:15:36AM -0300, Alvaro Herrera wrote: > > Haribabu Kommi wrote: > > > > > And also not returning "default host" details, because for the conninfo > > > without any host details, the

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-08 Thread Michael Paquier
On Fri, Jan 05, 2018 at 09:15:36AM -0300, Alvaro Herrera wrote: > Haribabu Kommi wrote: > > > And also not returning "default host" details, because for the conninfo > > without any host details, the return value must be NULL. But this change > > may break the backward compatibility of the

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-05 Thread Alvaro Herrera
Haribabu Kommi wrote: > And also not returning "default host" details, because for the conninfo > without any host details, the return value must be NULL. But this change > may break the backward compatibility of the function. I wouldn't want to have to fight that battle. > or > > write two

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-04 Thread Haribabu Kommi
On Fri, Jan 5, 2018 at 12:05 AM, Michael Paquier wrote: > 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

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-04 Thread Michael Paquier
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;

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-04 Thread Michael Paquier
On Thu, Jan 04, 2018 at 05:21:02PM +1100, Haribabu Kommi wrote: > On Thu, Jan 4, 2018 at 11:53 AM, Michael Paquier > wrote: > > > On Wed, Jan 03, 2018 at 06:48:07PM +1100, Haribabu Kommi wrote: > > > On Wed, Jan 3, 2018 at 12:25 PM, Haribabu Kommi < > >

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-04 Thread Alvaro Herrera
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

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-03 Thread Michael Paquier
On Wed, Jan 03, 2018 at 06:48:07PM +1100, Haribabu Kommi wrote: > On Wed, Jan 3, 2018 at 12:25 PM, Haribabu Kommi > Last patch has undefined symbol, corrected patch attached. + memset(walrcv->host, 0, NAMEDATALEN); + if (host) + strlcpy((char

Re: Enhance pg_stat_wal_receiver view to display connected host

2018-01-02 Thread Haribabu Kommi
On Wed, Jan 3, 2018 at 12:25 PM, Haribabu Kommi wrote: > > > update patch attached. > Last patch has undefined symbol, corrected patch attached. Regards, Hari Babu Fujitsu Australia pg_stat_wal_receiver-to-display-connected-host_v3.patch Description: Binary data

Re: Enhance pg_stat_wal_receiver view to display connected host

2017-12-21 Thread Haribabu Kommi
On Thu, Dec 21, 2017 at 11:12 PM, Michael Paquier wrote: > On Thu, Dec 21, 2017 at 8:16 PM, Haribabu Kommi > wrote: > > The current connected host details are already available in the PGconn > > structure, > > Exposing those details in the

Enhance pg_stat_wal_receiver view to display connected host

2017-12-21 Thread Haribabu Kommi
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