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

# PostgreSQL destination

> Configure PostgreSQL as a live MantrixFlow destination connection.

PostgreSQL is the live destination connector documented for the current MantrixFlow app.

## Required access

Use a database user with write access to the destination schema and tables.

MantrixFlow does not create final destination tables during delivery. Create the
table with the pipeline setup action or with SQL before starting a run.

## Connection fields

| Field           | Notes                                    |
| --------------- | ---------------------------------------- |
| Connection Name | A human-readable name shown in the app   |
| Host            | Database host or provider endpoint       |
| Port            | Usually `5432`                           |
| Database        | Database name                            |
| Username        | Destination user                         |
| Password        | Destination user password                |
| Schema          | Usually `analytics` for reporting tables |
| SSL Mode        | Use `require` for most hosted databases  |

## Destination table requirements

Create the target table from discovered source columns in the Destination panel,
or create it manually before the first run:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
CREATE SCHEMA IF NOT EXISTS analytics;

CREATE TABLE IF NOT EXISTS analytics.orders_live (
  id bigint PRIMARY KEY,
  customer_id bigint,
  order_status text,
  total_amount numeric,
  created_at timestamptz,
  updated_at timestamptz
);
```

In the Destination panel, enter final delivery targets as `schema.table`, for example `analytics.orders_live`.

## Write behavior

The live write mode is **Upsert**.

* If the destination table has a primary key, MantrixFlow uses merge-style delivery.
* If the destination table has no primary key, MantrixFlow appends rows and records a no-primary-key warning.

## Setup flow

1. Open **Connections**.
2. Click **+ New Connection**.
3. Set role to **Destination**.
4. Choose **PostgreSQL**.
5. Fill the form.
6. Click **Test Connection**.
7. Save only after the test succeeds.
