# PostgreSQL

Open-source relational database

- Category: Databases
- Runs in: the Phloem cloud

Lets you and Hamming query a PostgreSQL database with SQL, with its tables listed in Trace.

## What Phloem reads
- Schemas, tables, views, columns and foreign keys, listed in Trace for Hamming and SQL autocomplete
- System schemas (`information_schema`, `pg_catalog`) are left out

## What you need
- The server's host and port (default 5432), reachable from Phloem's cloud
- The database name
- A username and password. Best: a dedicated `phloem` role with `SELECT` on the schemas you want.

Your credentials are stored in Phloem's cloud and used only to query this database.

## What Hamming can do
- Run SQL that you or Hamming write

## Notes
- Phloem runs any statement, not only `SELECT`. The role's privileges decide what a query can change.
- Use a replica endpoint for heavy analysis.

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Host | Text | Yes |  |
| Port | Number | No |  |
| Database | Text | Yes |  |
| Username | Text | Yes |  |
| Password | Secret | Yes |  |
