# PostgreSQL

Connect to PostgreSQL for advanced analytics, geospatial data, and complex queries on structured data.

## Why connect PostgreSQL?

Connecting PostgreSQL means your team stops exporting it by hand and starts working with it directly inside Dex.

### What you get

1. Query live data in PostgreSQL without exporting it or standing up a new pipeline
2. Keep dashboards and dbt models in sync with PostgreSQL instead of a stale nightly copy
3. Give teams governed, self-serve access to PostgreSQL under the same RBAC and audit trail as everything else

## How it works

Explore, transform, maintain: the Dex loop on PostgreSQL.

### Point Dex at PostgreSQL

Install Dex in Claude Code by running

```
/plugin marketplace add exmergo/exmergo-agent-plugins
/plugin install dex@exmergo
/dex:explore
```

against PostgreSQL. Dex connects with your PostgreSQL credentials directly, so they, and your raw data, never enter the model's context.

### Explore before touching anything

`/dex:explore` profiles the schema it finds in PostgreSQL and proposes what to model before writing a single line of dbt.

### Author governed dbt models

`/dex:transform` writes and maintains the dbt models and tests that turn raw PostgreSQL data into trusted, reusable tables in your project.

### Stay inside a cost guard

Dex enforces a cost guard on every query it runs against PostgreSQL, so exploration never turns into a surprise bill.

### Catch drift automatically

`/dex:maintain` flags it when PostgreSQL's schema changes and proposes the fix, instead of letting your dbt project silently drift out of sync.

## Other warehouses

Dex brings the same loop and the same guardrails to each of these:
- **BigQuery**
- **Snowflake**
- **Databricks**
- **Redshift**
- **ClickHouse**
- **Trino**
- **DuckDB**

## Need a connector we don't support yet?

Tell us about your data source and we'll let you know as soon as the connector is available.
