> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Postgres

> Connect Summation to a PostgreSQL database.

Summation connects to PostgreSQL — and any compatible flavor (Amazon RDS, Aurora Postgres, Cloud SQL, Azure Database for PostgreSQL, Supabase, Neon, etc.) — using standard host/port credentials.

## What you'll need

* A reachable **host** and **port** (default `5432`).
* A **database** name.
* A **user** with `CONNECT` on the database, `USAGE` on the schemas, and `SELECT` on the tables you want exposed. See [GRANT](https://www.postgresql.org/docs/current/sql-grant.html) in the Postgres docs.
* For most managed providers, an **SSL mode** that matches the server's TLS configuration. See [SSL Support](https://www.postgresql.org/docs/current/libpq-ssl.html).

<Tip>
  Create a dedicated read-only role for Summation. Its queries are then auditable and there's no way for the connector to modify data.
</Tip>

### Where to find host/port for your provider

| Provider                          | Where to look                                                                                                                                                                                                          |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Amazon RDS / Aurora**           | RDS console → your DB instance → **Connectivity & security** → **Endpoint and port**. See [Connecting to a DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html). |
| **Google Cloud SQL**              | Cloud SQL console → your instance → **Connections**. See [About connection options](https://cloud.google.com/sql/docs/postgres/connect-overview).                                                                      |
| **Azure Database for PostgreSQL** | Azure portal → your server → **Overview**. See [Connect with Azure CLI](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/connect-azure-cli).                                                         |
| **Supabase**                      | Project dashboard → **Project Settings** → **Database** → **Connection info**. See [Connect to Postgres](https://supabase.com/docs/guides/database/connecting-to-postgres).                                            |
| **Neon**                          | Project dashboard → **Connection Details**. See [Connect to your database](https://neon.tech/docs/connect/connect-from-any-app).                                                                                       |

## Form fields

| Field                    | Required | Stored as | Notes                                                                                                                                                                                     |
| ------------------------ | -------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Host**                 | Yes      | Config    | DNS name or IP, e.g. `db.example.com`.                                                                                                                                                    |
| **Port**                 | Yes      | Config    | Default `5432`.                                                                                                                                                                           |
| **Database**             | Yes      | Config    | The Postgres database name (not a schema).                                                                                                                                                |
| **Username**             | Yes      | Config    | Login role.                                                                                                                                                                               |
| **Password**             | Yes      | Secret    |                                                                                                                                                                                           |
| **SSL Mode**             | Optional | Config    | One of `disable`, `require`, `verify-ca`, `verify-full`. Default `verify-full`. See [SSL Mode descriptions](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-PROTECTION). |
| **CA Certificate**       | Optional | Secret    | Upload or paste a PEM CA bundle for `verify-ca` / `verify-full`. See [SSL Client File Usage](https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-FILEUSAGE).                 |
| **Connection Pool Size** | Optional | Config    | Max concurrent connections from Summation. Default `10`.                                                                                                                                  |

### SSL modes

| Mode          | What it does                                                          |
| ------------- | --------------------------------------------------------------------- |
| `disable`     | No SSL. Don't use over the public internet.                           |
| `require`     | TLS on; certificate not verified.                                     |
| `verify-ca`   | TLS on; certificate verified against a trusted CA.                    |
| `verify-full` | TLS on; certificate verified *and* hostname checked. **Recommended.** |

If your provider uses a self-signed CA, supply the bundle in **CA Certificate**. Most managed Postgres providers work with `verify-full` out of the box.

## Setup SQL

```sql theme={null}
CREATE ROLE summation LOGIN PASSWORD '<strong-password>';

GRANT CONNECT ON DATABASE analytics       TO summation;
GRANT USAGE   ON SCHEMA public            TO summation;
GRANT SELECT  ON ALL TABLES IN SCHEMA public TO summation;

ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO summation;
```

## Adding datasets

Source references use the form:

```
postgres:my_database.my_schema.my_table
```

## Common problems

| Error or symptom                                  | Likely cause                                                                 |
| ------------------------------------------------- | ---------------------------------------------------------------------------- |
| `connection refused`                              | Wrong host/port, or your firewall doesn't allow Summation's egress IPs.      |
| `SSL connection is required`                      | The server requires TLS. Set **SSL Mode** to `require` or stricter.          |
| `server certificate ... does not match host name` | The cert's CN/SAN doesn't include the host. Fix the cert or use `verify-ca`. |
| `permission denied for relation ...`              | Grant `SELECT` on the table to the Summation role.                           |
