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

# PostgreSQL

**pREST** turns a PostgreSQL database into an instant REST API and (from v2.1.0) a read-only MCP endpoint. PostgreSQL is the **Native** adapter — the first and primary dialect implementation.

*Last updated: July 11, 2026* · **Label:** Native

***

## Supported features

| Capability                                                | Status                                                                                                                                                |
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Connection                                                | supported                                                                                                                                             |
| Schema discovery                                          | supported                                                                                                                                             |
| CRUD                                                      | supported                                                                                                                                             |
| Filtering / ordering / pagination                         | supported                                                                                                                                             |
| Transactions                                              | supported                                                                                                                                             |
| Scripts (`/_QUERIES`)                                     | supported                                                                                                                                             |
| MCP (`/_mcp`)                                             | supported (v2.1.0+)                                                                                                                                   |
| ACL / permissions                                         | supported                                                                                                                                             |
| pgvector KNN / distance filtering (`_korder`, `:vecdist`) | supported (v2.4.0+, requires `pgvector` extension) — see [Parameters](/api-reference/parameters.md#pgvector-knn-ordering-and-distance-filtering-v240) |

***

## Connection

```sh
export PREST_VERSION=2
export PREST_PG_URL='postgres://user:pass@localhost:5432/mydb?sslmode=disable'
# or discrete PREST_PG_HOST / PREST_PG_USER / PREST_PG_PASS / PREST_PG_DATABASE
```

TOML `[pg]` and multi-database `[[databases]]` are documented in [Configuring pREST](/get-started/configuring-prest.md) and [Multi-database](/get-started/multi-database.md).

***

## Quick CRUD example

**REST (Representational State Transfer)** maps HTTP verbs to CRUD on SQL tables at `/{database}/{schema}/{table}` — [API Reference](/api-reference.md).

```http
GET /mydb/public/users
POST /mydb/public/users
Content-Type: application/json

{"name": "ada"}
```

See also [Parameters](/api-reference/parameters.md).

***

## MCP

**MCP (Model Context Protocol)** is an open standard for connecting AI apps and agents to tools and data. On PostgreSQL, pREST exposes read-only MCP at `/_mcp` on the same server as REST — [MCP over HTTP](/get-started/mcp-over-http.md).

```http
GET /_mcp
POST /_mcp
```

AI client setup: [docs.prestd.com/ai](https://docs.prestd.com/ai).

***

## Known limitations

* Requires PostgreSQL **9.5+** (project baseline).
* SQL dialect features beyond what the adapter generates (exotic types, some extensions) may need [custom queries](/api-reference/custom-queries.md).
* Other SQL engines are not this adapter — see [roadmap](/databases/roadmap.md).

***

## Related

* [Databases](/databases.md)
* [Acronyms](/readme/acronyms.md) ([REST](/readme/acronyms.md#rest), [MCP](/readme/acronyms.md#mcp))
* [Get pREST](/get-prest.md)
* [Deploying with Docker](/deployment/deploying-with-docker.md)
* [Permissions](/get-started/permissions.md)
