# PostgreSQL

Source: https://athas.dev/docs/postgresql

Connect to PostgreSQL databases, inspect schemas, and run queries from Athas.

PostgreSQL support is available through the PostgreSQL database provider.

## Connect to PostgreSQL

Install the PostgreSQL provider from **Integrations**, then use **Database: Connect to
Database** from the command palette or create a saved connection in **Settings > Database**.

The default PostgreSQL port is `5432`.

## What You Can Do

- Browse schemas, tables, and views
- Inspect columns, indexes, and foreign keys where available
- Filter and search table data
- Run SQL queries
- Edit rows and cells where supported
- Copy or export result data when available

## Notes

PostgreSQL connections are saved connections. They are managed from **Settings > Database** rather
than opened from local files.

## First query

Start with a read query to confirm the connection and inspect the database:

```sql
SELECT current_database(), current_user;
```

## Troubleshooting

Check host, port, database name, user and server SSL requirements. Use a read-only account for inspection.

See [Database viewer](https://athas.dev/docs/database-viewer) for shared connection and editing behavior.
