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

# PostgreSQL

> Connect a PostgreSQL database to Cobi

## Best Practices

### Create a Read-Only User

We strongly recommend creating a dedicated database user with read-only permissions:

```sql theme={null}
CREATE USER cobi_reader WITH PASSWORD 'secure_password';
GRANT CONNECT ON DATABASE your_database TO cobi_reader;
GRANT USAGE ON SCHEMA public TO cobi_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO cobi_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO cobi_reader;
```

### Limit Table Access

If you only want Cobi to access specific tables, grant permissions selectively:

```sql theme={null}
-- Grant access to specific tables only
GRANT SELECT ON customers, transactions, orders TO cobi_reader;
```

## Troubleshooting

See the [Troubleshooting](/platform/data-connectors/troubleshooting) page for help with connection issues.
