Connect to Postgres
Create a Postgres connection with username and password secrets, choose its TLS mode and schemas, and add an optional staging schema.
This page explains how to connect a Postgres database to Bobsled AI. A Postgres connection uses a host, port, database, optional schema filters, and named secrets for both username and password. For the steps that every provider shares, see Create and manage connections.
Before you begin
- Get the role that creates connections.
- Make sure that the host resolves only to public IP addresses. Bobsled AI refuses a Postgres host that resolves to a private address.
- Create named secrets for the username and the password.
- Optional: To join uploaded CSV data with Postgres queries, create a staging schema in the configured database.
Required permissions
For a staging schema, grant the connection user the following permissions:
USAGEandCREATEon the schema.- Permission to read and delete its own staging tables.
Create a Postgres connection
To create a Postgres connection, do the following:
- On the Connections page, click Add connection, and then select Postgres.
- Enter a Display name.
- Enter the Host, Port, and Database.
- In TLS mode, select a mode. For more information, see TLS modes.
- Select the Username secret and the Password secret.
- In Data scope, enter the Default schema.
- Optional: Enter Included schemas and Excluded schemas.
- Optional: Enter a Staging schema. Leave it blank to use the existing execution path.
- Click Save connection. Bobsled AI tests the connection.
With a staging schema, Test connection also creates a probe table in it, writes and reads one row, and drops the table. If the test fails, see Troubleshoot a failed test.
TLS modes
TLS mode has the following options:
- Verify CA and hostname: Encrypts the connection and verifies the server certificate and hostname. Select it if the provider supports full certificate verification.
- Require encryption: Encrypts the connection without verifying the certificate or hostname.
Don't weaken TLS only to make a test pass. Correct the trust or endpoint configuration instead.
What's next
- To inspect the schemas and tables that the user can see, see Discover namespaces and assets.
- To attach a CSV file in a chat and join it with Postgres tables, see Attachments.
- To rotate the password, see Rotate credentials.