Skip to content
Skip to content
PGB Learn

Connect from your app and tools

The Connection page

Open Databases > Connection. The first card lists Host Endpoint, TLS Public Port, Database Name, Username / Role, Password and SSL Mode (require). Connections are TLS-only. Use Hide Credentials when sharing your screen.

If the password is not stored, strings show [YOUR_PASSWORD]. Rotate Role Key creates a new one; update your apps afterward.

Three kinds of string

  • Pooled (DATABASE_URL): everyday app traffic, serverless and edge. Connections are shared one transaction at a time. Prepared statements work; plain SET, LISTEN/NOTIFY and advisory locks do not last between transactions.
  • Regular (DIRECT_URL, session): migrations, pg_dump, schema tools.
  • Direct: straight to the database server, same uses as regular.

Typically the direct port is 5433 and the pooled port 6432, but copy what the page shows.

Connect from a tool

  1. Choose Copy Pooled URL or Copy Regular URL.
  2. Replace [YOUR_PASSWORD] if needed.
  3. In psql run psql "<connection string>".
  4. In an app, put it in an environment variable (the App Framework Quick-Start has tabs for .env, Node / TS, Prisma, Drizzle, Python and psql CLI).

Check it

Connection Check tests each string from our side. Use Test again after changes.

Your database's own address

Where shown, Your database's own address is recommended: it can be faster and keeps working if your database moves. Your old address still works until you remove it.

Try it

Copy the pooled URL, connect with psql, and run select 1;.

Recap

  • Pooled for apps, regular or direct for migrations and tools.
  • Rotate the role key if a password leaks, then update apps.

Open Access Course

Free

forever
  • 9 structured lessons across 6 modules
  • Interactive knowledge checks with instant feedback
  • Verifiable completion certificate & PDF