Is there a way to determine the actual database hostname to which PostgREST is connected? #3914
-
I am using Amazon Aurora PostgreSQL 15.8 and have one PostgREST pod pointed at the primary read-write endpoint and another PostgREST pod pointed at a read-only replica endpoint. However, when I configured the read-only PostgREST pod according to the documentation, PostgREST returns the following error when starting up:
For security reasons, I have removed the hostname, IP address and port, but the values are for the primary read-write endpoint. I ran I'm using libpq environment variables to set configuration for PostgREST and tried the following combinations.
My DBAs have confirmed that the read-only replica is indeed a read-only replica. However, when making GET requests to the PostgREST read-only pod, we confirmed that the primary read-write endpoint is receiving the request which is leading me to suspect that it might be a networking issue. What does PostgREST do to determine whether the host is a read-only replica? Is there a way to determine the actual database hostname/address to which PostgREST is connected? The only messages that I see in the logs are schema loaded messages, and I have |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
This doesn't look like a PostgREST issue to me. We are not doing anything special here. What happens when you connect with SELECT current_setting('server_version_num')::integer, current_setting('server_version'), version(); |
Beta Was this translation helpful? Give feedback.
I stood up a PostgREST container locally and was able to successfully connect to the replica in question. As initially suspected, this was not a PostgREST or database problem, but a problem with our networking config in Istio.
Thanks for the discussion! PostgREST has been my favorite part of our stack. I will close this as resolved.