Introducing Miniloop Agents: AI agents that connect to your appsRead more

How to Find Your PostgreSQL Connection String

Last updated April 1, 2026

Your PostgreSQL connection string contains everything needed to connect to your database. Here's how to find it for popular providers.

Connection String Format

A PostgreSQL connection string follows this format:

postgresql://username:password@host:port/database?sslmode=require

Finding Your Connection String by Provider

Neon

  1. Open your project dashboard
  2. Click Connection Details
  3. Copy the connection string (starts with postgresql://)

Supabase

  1. Go to Project Settings (gear icon)
  2. Click Database
  3. Find Connection string under Connection info, or click Connect at the top
  4. Choose URI format

Railway

  1. Select your PostgreSQL service
  2. Click the Connect tab
  3. Click Show next to Postgres Connection URL

Render

  1. Go to your database's Info page
  2. Scroll to Connections
  3. Copy the External Database URL

AWS RDS

  1. Open the RDS console
  2. Select your database instance
  3. Find the Endpoint under Connectivity
  4. Build your connection string: postgresql://username:password@endpoint:5432/database

Connection Details Method

If you prefer to enter details separately:

FieldDescriptionExample
HostDatabase server hostnamedb.example.com
PortServer port (default 5432)5432
UserDatabase usernamepostgres
PasswordUser passwordyour-password
DatabaseDatabase namemyapp_production

SSL Configuration

Most cloud databases require SSL:

ProviderEnable SSLVerify Certificate
NeonYesNo
SupabaseYesNo
RailwayYesNo
RenderYesNo
AWS RDSYesYes (with CA cert)
Local/DockerNoNo

Troubleshooting

"Connection refused" or timeout

  • Verify your database allows external connections
  • Check if your database has IP allowlisting
  • Confirm the host and port are correct

"Password authentication failed"

  • Double-check username and password
  • For connection strings, encode special characters: @ becomes %40, # becomes %23

"SSL required" errors

  • Enable SSL in your connection settings
  • Try setting Verify Certificate to No

Automate Your Database Workflows

Once you have your connection string, you can connect PostgreSQL to Miniloop to automate data queries, reporting, and database-triggered workflows using natural language. Describe what data you need, and Miniloop handles the rest.

Frequently Asked Questions

Should I use the connection string or individual fields?

Connection strings are easier if your provider gives you one. Use individual fields if you need more control over SSL settings or if your password contains special characters that cause parsing issues.

What permissions does the database user need?

For querying data, the user needs SELECT permissions on the tables you want to access. For triggers and subscriptions, you may need additional permissions to create functions.

Can I connect to a local database?

Cloud services can't directly access databases on localhost. You'll need to expose your database to the internet or use a tunneling service. For production, use a cloud-hosted database.

Is my connection string secure?

Never share your connection string publicly or commit it to version control, as it contains your database password. Use environment variables or secrets management.