I have the following database replication setup:

enter image description here

As you can see I do a master-slave replication and I use aload balancer in order to connect into read-only replicas.

So I want to test this setup, hence I connect into my database into postgresql read-only replicas via Load Labalcer via psql command.

But how I can find out which replica I am connected into? I need that in order to perform a stress test.

  • 2
    select inet_server_addr(); maybe? That returns the IP address of the database host.
    – user1822
    Sep 26, 2019 at 12:20


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.