> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/fabricate/workspaces/workspace-server-connections/server-connection-details/postgresql.md).

# PostgreSQL

For PostgreSQL:

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FWmlyKkFOLEudQAGBYkNf%2FWorkspace_NewServerConnectionPostgreSQL.png?alt=media&amp;token=7c0dfe45-4b13-47e8-8658-852ad32e2a98" alt=""><figcaption><p>New Server Connection panel for a PostgreSQL server connection</p></figcaption></figure>

## Providing the basic connection information <a href="#basic-connection" id="basic-connection"></a>

1. In the **Host** field, provide the hostname for the server.
2. In the **Port** field, provide the port to connect through.
3. From the **SSL/TLS** dropdown list, select whether to enable or require Secure Socket Layer (SSL) or Transport Layer Security (TLS).

   \
   If you select either **Verify CA** or **Verify Full**, you must add the required certificate to the [account certificates list](/fabricate/fabricate-accounts-and-users/account-ca-certificates.md).

## Connecting through an SSH tunnel <a href="#ssh-tunnel" id="ssh-tunnel"></a>

To connect through an SSH tunnel:

1. Check the **Connect through a tunnel** checkbox.
2. From the **Tunnel** dropdown list, either:
   1. Select an existing network tunnel to use.
   2. To create a new tunnel, select **Add a new workspace network tunnel**.

If you select the option to create a new tunnel, Fabricate displays the **Add Network Tunnel** panel for you to configure the new tunnel.

For information about how to configure a network tunnel, go to [Configuring available SSH tunnels for a workspace](/fabricate/workspaces/workspace-network-tunnels.md#adding-a-tunnel).

## Configuring the authentication <a href="#authentication" id="authentication"></a>

### Selecting the authentication method <a href="#authentication-method" id="authentication-method"></a>

From the **Authentication** dropdown list, select the type of authentication to use.

The options are:

* **Username & Password**. This is the default.
* **AWS IAM Role**. To use this option, you must first [configure the available AWS roles for the workspace](/fabricate/workspaces/workspace-aws-roles.md).
* **Azure AD Service Principal**. To use this option, you must first [configure the available Azure service principals for the workspace](/fabricate/workspaces/workspace-service-principals.md).

### Providing a username and password <a href="#username-password" id="username-password"></a>

For username and password authentication:

1. In the **Username** field, provide the username to use to make the connection.
2. In the **Password** field, provide the password.

### Providing an AWS role <a href="#aws-role" id="aws-role"></a>

For AWS IAM role authentication:

1. In the **Username** field, provide the username to use to make the connection.
2. From the **AWS Role** dropdown, select the role to use.

### Providing an Azure service principal <a href="#azure-service-principal" id="azure-service-principal"></a>

For Azure AD service principal authentication:

1. In the **Username** field, provide the username for the Microsoft Entra user to use to make the connection. The user must be mapped to the service principal that you select.
2. From the **Azure Service Principal** dropdown, select the service principal to use.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tonic.ai/fabricate/workspaces/workspace-server-connections/server-connection-details/postgresql.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
