Connect with psql

Stable

A 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

  1. Save the DSN in an environment variable:
export SPG99_DSN="postgres://<pg_user>:<pg_password>@<gateway-host>:5432/<db-name>?sslmode=require"
  1. Connect:
psql "$SPG99_DSN"
  1. 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_timeout and 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.