Connect with psql
StableA quick way to verify the DSN and make the first connection to a database through Gateway.
Updated: March 5, 2026
Use the DSN from Console, CLI, or the API.
Quick connection
- Save the DSN in an environment variable:
export SPG99_DSN="postgres://<pg_user>:<pg_password>@<gateway-host>:5432/<db-name>?sslmode=require"
- Connect:
psql "$SPG99_DSN"
- Check connection parameters:
\conninfo
What is important to remember
- On the first connection to a stopped database, Gateway may initiate compute autostart.
- If the first attempt does not wait long enough for startup, retry with backoff.
- For production scenarios, account for cold start in
connect_timeoutand in your application's overall retry policy.
This approach is useful because it lets you quickly verify credentials, TLS, and the actual database reachability without extra scaffolding.
