Em qui, 11 de abr de 2019 às 21:16, Tatsuo Ishii <is...@sraoss.co.jp> escreveu:
>
> Currently pg_stat_replication view does not tell useful information
> regarding client connections if UNIX domain sockets are used for
> communication between sender and receiver. So it is not possible to
> tell which row corresponds to which standby server.
>
application_name. I'm not sure if it solves your complain but Peter
committed a patch [1] for v12 that distinguishes replicas in the same
host via cluster_name.

> test=# select client_addr, client_hostname, client_port,sync_state 
> client_port from pg_stat_replication;
>  client_addr | client_hostname | client_port | client_port
> -------------+-----------------+-------------+-------------
>              |                 |          -1 | async
>              |                 |          -1 | async
> (2 rows)
>
> This is due to that pg_stat_replication is created from
> pg_stat_get_activity view. pg_stat_get_activity view calls
> pg_stat_get_activity() which returns always NULL, NULL, -1 for
> client_add, client_hostname and client_port.
>
Socket has different semantic from TCP/UDP. We can't add socket
information into client_addr unless we are prepared to break this view
(client_addr has type inet and it would be necessary to change it to
text). It could break a lot of applications.


[1] 
https://www.postgresql.org/message-id/flat/1257eaee-4874-e791-e83a-46720c72c...@2ndquadrant.com


-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


Reply via email to