# PostgreSQL

{% embed url="<https://www.youtube.com/watch?v=ZwlXNllncXw>" %}

As a best practice, create a dedicated PostgreSQL user with only the privileges needed for your Connecty integration and configure SSL mode to meet your security requirements. This isolates your integration credentials and simplifies permission management, ensuring a seamless no-code connection.

### Prerequisites

* **Host**
* **Port** (default: 5432)
* **Username** and **Password**
* **Database Name**
* *(Optional)* **SSL Mode**

### 1. Host and Port

Your PostgreSQL **Host** is the address of the server where your database is running.

{% hint style="info" %}

* This can be an IP address (`192.168.1.100`) or a hostname (`myaurora.cluster-c25.us-east-1.rds.amazonaws.com`).
* The **Port** is usually `5432` unless your administrator has configured a custom port.
* ✅ Host: `db.mycompany.com`
* ✅ Port: `5432`
* ❌ Host: `postgres://db.mycompany.com` (do **not** include the protocol in the host field)
  {% endhint %}

### 2. Username and Password

These credentials authenticate you to the database.

* **Username**: the database user name.
* **Password**: the password associated with that user.

### 3. Database Name

The **Database Name** is the specific database you want to connect to on the server.

{% hint style="info" %}
You can list available databases via the `\l` command in `psql` or by querying:\
\
`SELECT datname FROM pg_database WHERE datistemplate = false;`
{% endhint %}

### 4. SSL Mode (Optional)

Controls whether and how SSL/TLS is used for the connection. Common values:

* `disable` : no SSL (not recommended).
* `require` : SSL is required, but the server certificate is **not** verified.
* `verify-ca` : SSL required and server certificate **must** be signed by a trusted CA.
* `verify-full` : SSL required and server hostname **must** match certificate.

For `verify-ca` and `verify-full` options please contact our support.

{% hint style="info" %}
If you don’t specify SSL Mode, most clients default to \`disable\`.
{% endhint %}


---

# 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://connectyai.gitbook.io/documentation/getting-started/data-connections-guide/postgresql.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.
