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
- Open your project dashboard
- Click Connection Details
- Copy the connection string (starts with
postgresql://)
Supabase
- Go to Project Settings (gear icon)
- Click Database
- Find Connection string under Connection info, or click Connect at the top
- Choose URI format
Railway
- Select your PostgreSQL service
- Click the Connect tab
- Click Show next to Postgres Connection URL
Render
- Go to your database's Info page
- Scroll to Connections
- Copy the External Database URL
AWS RDS
- Open the RDS console
- Select your database instance
- Find the Endpoint under Connectivity
- Build your connection string:
postgresql://username:password@endpoint:5432/database
Connection Details Method
If you prefer to enter details separately:
| Field | Description | Example |
|---|---|---|
| Host | Database server hostname | db.example.com |
| Port | Server port (default 5432) | 5432 |
| User | Database username | postgres |
| Password | User password | your-password |
| Database | Database name | myapp_production |
SSL Configuration
Most cloud databases require SSL:
| Provider | Enable SSL | Verify Certificate |
|---|---|---|
| Neon | Yes | No |
| Supabase | Yes | No |
| Railway | Yes | No |
| Render | Yes | No |
| AWS RDS | Yes | Yes (with CA cert) |
| Local/Docker | No | No |
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.