I'm trying to check whether or not I'm connected to a specific reader instance in AWS Aurora's PostgreSQL server. When I was doing this in MySQL I was able to use SELECT @@aurora_server_id to check if I was connected to let's say reader#3 instead of reader#2. I was wondering if there was a function in PostgreSQL that I could use. I found that SELECT * FROM aurora_replica_status() can be used to see which one is the writer instance but not the one you are currently connected to.
Thanks!