---
name: Postgres
menu: Connecting to Databases
route: /docs/databases/postgres
index: 21
version: 1
---

## Postgres

Note that the Postgres connector library [psycopg2](https://www.psycopg.org/docs/) comes out of the
box with Superset.

Postgres sample connection parameters:

- **User Name**: UserName
- **Password**: DBPassword
- **Database Host**:
  - For Localhost: localhost or 127.0.0.1
  - For On Prem: IP address or Host name
  - For AWS Endpoint
- **Database Name**: Database Name
- **Port**: default 5432

The connection string looks like:

```
postgresql+psycopg2://{username}:{password}@{host}:{port}/{database}
```

Extra parameters:

```
?sslmode=require
```

More information about PostgreSQL connection options can be found in the
[SQLAlchemy docs](https://docs.sqlalchemy.org/en/13/dialects/postgresql.html#module-sqlalchemy.dialects.postgresql.psycopg2)
and the
[PostgreSQL docs](https://www.postgresql.org/docs/9.1/libpq-connect.html#LIBPQ-PQCONNECTDBPARAMS).
