Reputation: 673
I have a Postgres database that uses physical replication. I want to get list of replicas.
Tried to select * from pg_stat_replication
,I have two rows for replicas, but client_hostname
field is empty. Documentation says that "it indicates that the client is connected via a Unix socket on the server machine". So how can I get replica connection strings/hostname/IP or any other way I can connect to replica to send query?
Upvotes: 0
Views: 2127
Reputation: 673
In my case, it turned out to be the lack of permissions for user. I added him a corresponding role and everything fixed.
Upvotes: 0
Reputation: 246473
You cannot get that by querying the primary server. All the primary server sees is the client IP address from which the standby server connects, and that could be on a different network or even (as in your case) using a different connection method from a client connection to the standby server.
Upvotes: 1