# PostgreSQL

Connect a cloud-hosted PostgreSQL database to Sequel and query it in natural language from the app or any MCP client.

Connect a cloud-hosted PostgreSQL database to Sequel and query it in plain English — from the Sequel app or any AI tool wired up to the [MCP server](/docs/install). This works with managed Postgres anywhere: Amazon RDS/Aurora, Supabase, Neon, Render, Railway, Heroku, Digital Ocean, and similar.

## What you'll need

- A **cloud-hosted PostgreSQL** database reachable over the internet.
- A database **connection string** (or host, port, database, user, and password).
- A user with **read access** to the schemas you want to query.

<Callout type="tip" title="Use a read-only user">
Create a dedicated read-only role for Sequel. It's the simplest way to guarantee queries can't modify your data, and it scopes access to just the tables you intend to expose.
</Callout>

## Connect it

<Steps>
<Step title="Open a new connection">
In the Sequel dashboard, go to **Connections → New connection** and choose **PostgreSQL**.
</Step>

<Step title="Enter your connection string">
Paste your connection string. It usually looks like this:

<CodeBlock language="bash" label="Connection string">postgresql://USER:PASSWORD@HOST:5432/DATABASE?sslmode=require</CodeBlock>

Most managed providers require SSL — keep `sslmode=require` unless your provider says otherwise.
</Step>

<Step title="Allow network access">
If your database restricts inbound traffic, allow connections from Sequel so the test can reach it. Check your provider's networking/allowlist settings.
</Step>

<Step title="Test and save">
Sequel verifies the credentials and reads your schema. A green check means it's live.
</Step>
</Steps>

## Try it

Once connected, ask things like:

- "How many rows are in each table?"
- "Show me the 10 most recently created users."
- "What foreign keys reference the `orders` table?"
- "Plot daily signups for the last 30 days."

## Troubleshooting

| Symptom | Likely fix |
| --- | --- |
| Connection test times out | Database isn't reachable from the internet, or an allowlist is blocking Sequel. |
| SSL/TLS error | Add or adjust `sslmode` (commonly `require`) to match your provider. |
| "Permission denied" on a table | The user lacks `SELECT` on that table or schema — grant read access. |

## Related

- [Connecting your first data source](/docs/connecting-your-first-data-source)
- [Chatting with your data](/docs/chatting-with-your-data)
- [Browse all integrations](/docs/integrations)
