# Integrating with Postgres

## Postgres Setup <a href="#bigquery-setup" id="bigquery-setup"></a>

Drivetrain connects to Postgres using a secure TCP/IP connection over the standard PostgreSQL port. To begin with the integration, you need to share below details with us to get started

### Required Details <a href="#add-an-external-user-in-bigquery" id="add-an-external-user-in-bigquery"></a>

1. **Hostname & Port**: We need this detail to locate your Postgres server and port to use for the connection. Eg: `your-db.company.com:5432`
2. **Username**: This is used to authenticate and identify the database user for the connection, please ensure user has **read** access to the schema and tables you intend to share
3. **Password:** Used along with the username to securely authenticate the connection to your database.
4. **Schema Name:** PostgreSQL organises data into schemas. This tells us which specific part of your database to look into.
5. **Table Names:** This helps us identify the specific tables within the schema from which data should be extracted.

### Best Practices

1. We recommend creating a **dedicated read-only user** for this integration to ensure access is limited and controlled.
2. if needed, we can provide our **static IP address** to allowlist in your firewall for secure connectivity.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.drivetrain.ai/integration-guide/integrate-with-drivetrain/databases-and-warehouses/integrating-with-postgres.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
