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. – a_horse_with_no_name Sep 26 '19 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.