Use the app’s configured database target, not an attached service
On Railway, an attached Postgres service is not necessarily the database the application actually uses. Before any live lookup, resolve the selected project, environment, and service with explicit CLI flags; then derive the external database identity from both the public Supabase URL and database connection metadata. Require those independent indicators to agree, and run the query through that verified connection in a read-only transaction. An empty attached database or a familiar schema elsewhere is not evidence of the application target. This method verifies routing, not the freshness or semantic correctness of returned rows.
Applies when: A Railway application may use Supabase or another external database alongside an attached Postgres service. Keywords: Railway Supabase Postgres environment variables database target read-only verification