Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-08-23 Thread Peter Eisentraut
On tor, 2010-05-27 at 22:32 +0300, Peter Eisentraut wrote: I suggest that we add the functions pg_stat_get_backend_server_addr and pg_stat_get_backend_server_port, but don't expose them in pg_stat_activity. (_server_port is really mostly for symmetry, because you can't currently bind to

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-07-22 Thread Peter Eisentraut
On ons, 2010-07-21 at 22:12 -0700, Jeff Davis wrote: The two functions aren't perfectly symmetric, because pg_stat_get_backend_server_port() returns -1 if it's a unix socket, and pg_stat_get_backend_server_addr() returns NULL (which is also overloaded to mean that you don't have

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-07-21 Thread Jeff Davis
On Fri, 2010-05-28 at 18:01 +0300, Peter Eisentraut wrote: Yes, I would like to know who is connecting to what IP address. It's useful if you have HA setups and you need to check which way your connections are going. A few comments on this patch: The two functions aren't perfectly symmetric,

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: There are functions pg_stat_get_backend_client_addr and pg_stat_get_backend_client_port, which are exposed through the pg_stat_activity view, but there is no straightforward way to get the server-side address and port of a

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from inet_server_addr() and inet_server_port(). I think the point is to let someone find out

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from inet_server_addr() and inet_server_port(). I think the point

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Peter Eisentraut
On fre, 2010-05-28 at 10:21 -0400, Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused how this is different from

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-28 Thread Bruce Momjian
Peter Eisentraut wrote: On fre, 2010-05-28 at 10:21 -0400, Bruce Momjian wrote: Tom Lane wrote: Bruce Momjian br...@momjian.us writes: Tom Lane wrote: ... indeed. Is it worth burdening the pg_stats mechanism with this? The use case seems vanishingly thin. I am confused

[HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-27 Thread Peter Eisentraut
There are functions pg_stat_get_backend_client_addr and pg_stat_get_backend_client_port, which are exposed through the pg_stat_activity view, but there is no straightforward way to get the server-side address and port of a connection. This is obviously much less commonly needed than the client

Re: [HACKERS] [9.1] pg_stat_get_backend_server_addr

2010-05-27 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: There are functions pg_stat_get_backend_client_addr and pg_stat_get_backend_client_port, which are exposed through the pg_stat_activity view, but there is no straightforward way to get the server-side address and port of a connection. This is obviously