> For the complete documentation index, see [llms.txt](https://docs.e6data.com/query-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.e6data.com/query-engine/developers/connecting-to-the-engine/postgresql-protocol.md).

# PostgreSQL protocol

Connect a stock PostgreSQL client to e6data over the PostgreSQL wire protocol - no e6data driver required.

e6data speaks the **PostgreSQL wire protocol**, so you can point a stock PostgreSQL client - `psql`, pgAdmin, DBeaver, Tableau's Postgres connector, or a generic PG-JDBC driver - straight at e6data with nothing to download.

## How it works

Connect to the PostgreSQL endpoint (`<PG_HOST>:5432`) over TLS. The **database name encodes the routing** as `<CLUSTER>/<CATALOG>`, your **username** is your email, and your **password** is a [personal access token](/query-engine/guides/security/access-tokens/pat-and-service-account-keys.md). Find your `<PG_HOST>` and a ready-to-copy connection string in the Console under **Cluster → Connectivity**.

## Connect

**psql:**

```bash
psql "host=<PG_HOST> port=5432 dbname=<CLUSTER>/<CATALOG> user=<EMAIL> sslmode=require"
```

**A full connection URL** (password is your PAT):

```
postgresql://<EMAIL>:e6pat_...@<PG_HOST>:5432/<CLUSTER>/<CATALOG>?sslmode=require&cluster=<CLUSTER>
```

**GUI tools** (pgAdmin, DBeaver, Tableau PostgreSQL connector):

| Field    | Value                   |
| -------- | ----------------------- |
| Host     | `<PG_HOST>`             |
| Port     | `5432`                  |
| Database | `<CLUSTER>/<CATALOG>`   |
| Username | `<EMAIL>`               |
| Password | a personal access token |
| SSL mode | `require`               |

## BI tools over PostgreSQL

Tableau and pgAdmin connect through their built-in PostgreSQL connectors - no e6data driver needed. **Power BI** and **Looker**, which don't have first-class e6data connectors yet, also connect through this PostgreSQL path (they speak to e6data as a Postgres source).

## Behavior to know

* **Suspended cluster:** the first connection to a suspended cluster returns SQLSTATE `57P03` ("cluster is being resumed, please retry"). Standard drivers (`libpq`, `psql`, recent `pgjdbc`) retry automatically while the cluster wakes (\~30–90 s).
* **TLS is always required** (`sslmode=require`).
* **Idle timeout:** PostgreSQL sessions have a 1-hour idle timeout by default.

## Troubleshooting

| Symptom                             | Likely cause                                     | Fix                                                         |
| ----------------------------------- | ------------------------------------------------ | ----------------------------------------------------------- |
| Client hangs on a suspended cluster | Driver not honoring `57P03`                      | Update the driver or add app-level retry                    |
| Wrong cluster's data                | `database` not in `<CLUSTER>/<CATALOG>` form     | Set the database to `<CLUSTER>/<CATALOG>`                   |
| Connection refused on `5432`        | PostgreSQL path not enabled, or a firewall block | Confirm the PG endpoint with your admin; open `5432` egress |
| `401`-style auth failure            | Expired or invalid token                         | Re-create the token in **Profile → Settings**               |

## See also

* [Connecting to the engine](/query-engine/developers/connecting-to-the-engine.md) - all protocols and the connection-string cheat sheet.
* [REST API for SQL queries](/query-engine/developers/connecting-to-the-engine/rest-api-for-sql.md)
* [Access tokens](/query-engine/guides/security/access-tokens.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.e6data.com/query-engine/developers/connecting-to-the-engine/postgresql-protocol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
