> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fyno.io/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fyno.io/docs/_mcp/server.

# Postgres

> Learn how to connect your PostgreSQL database to Fyno Connect and use the data to create cohorts for audience segmentation and campaign targeting.

Connect your PostgreSQL database to Fyno Connect with a connection URI. Once connected, you can build cohorts directly from the data in your database.

## Connect your PostgreSQL database

#### Open Postgres from Databases

Go to **Databases** and click **Postgres**. The **Add a PostgreSQL database** pop-up opens.

#### Enter the connection details

Fill in the following fields:

* **Custom Name**: A name to identify this connection in Fyno Connect.
* **PostgreSQL URI**: Paste your PostgreSQL connection string. The value is masked by default. Click the eye icon to view it.

![Add a PostgreSQL database pop-up](/docs/_fern-img/be288a9bbedf36f6e35d9eea0139033f2c6762811c6ca95a839cd79daec68833.webp)

#### Add the database

Click **Add Database**. Fyno tests the connection and saves it once the test succeeds. The database then appears under **Connected DBs** on the same page.

#### Create cohorts

You can now create cohorts from the data in your database. See [Create Cohorts](./how-to-create-a-cohort-in-fyno-connect).

## Connection string format

> **Check your connection string**
>
> If the connection test fails, make sure your connection string follows the standard format:
>
> ```
> postgresql://[user[:password]@][host][:port][/dbname][?param1=value1&...]
> ```