Unable to connect to read replica even using pooler
Hi Supabase Support Team,
I’m running into an issue accessing a read replica from an IPv4-only environment, and after extensive debugging this is what i've noticed:
Context:
Using the documented / community-recommended approach of connecting via the pooler as:
supabase_read_only_user.<project_ref>
However, this role does not exist in our project:
ERROR: role "supabase_read_only_user.<project_ref>" does not exist
Attempting to create our own read-only role:
Conclusion:
I’m running into an issue accessing a read replica from an IPv4-only environment, and after extensive debugging this is what i've noticed:
Context:
- environment is IPv4-only
- direct database and replica hostnames of the form: db.<project>-rr-<region>.supabase.co
are IPv6-only, so they are not reachable from my environment. I can successfully connect to the primary database via the Supabase pooler: aws-0-<primary-region>.pooler.supabase.com using the postgres user over IPv4
- Connecting to the pooler with: target_session_attrs=read-only This consistently fails with: session is not read-only
Using the documented / community-recommended approach of connecting via the pooler as:
supabase_read_only_user.<project_ref>
However, this role does not exist in our project:
ERROR: role "supabase_read_only_user.<project_ref>" does not exist
Attempting to create our own read-only role:
- The role can be created successfully in Postgres
- FATAL: Tenant or user not found
Conclusion:
- Direct replica access is IPv6-only
- IPv4 access requires the pooler
- Pooler-based replica access requires the built-in supabase_read_only_user - could you confirm this?