# PostgreSQL
source: https://docs.chalk.ai/docs/postgresql

## Integrate with SQL data sources.

Chalk supports PostgreSQL
as a SQL source.
You can configure the PostgreSQL-specific
options using the PostgreSQLSource init args,
or configure the source through your dashboard, and
reference the source in your code.

### Adding PostgreSQL

By navigating to Integrations > Add a data source and selecting PostgreSQL, you'll find a form where you can input information about your PostgreSQL integration.
Note that the data source must be accessible by the IAM Role defined in your cluster deployment.

### Integrations Setup

After configuring your PostgreSQL integration in the dashboard, define your data sources in Python:

```
from chalk.sql import PostgreSQLSource

risk_pg = PostgreSQLSource(name="RISK_PG")
marketing_pg = PostgreSQLSource(name="MARKETING_PG")
```

Then reference them in SQL file resolvers using the name parameter. For example, to query from the RISK_PG source:

```
-- type: online
-- resolves: User
-- source: RISK_PG
SELECT id, credit_score FROM users
```

And to query from the MARKETING_PG source:

```
-- type: online
-- resolves: User
-- source: MARKETING_PG
SELECT id, email, campaign_status FROM users
```







