PostgreSQL
Connect a PostgreSQL database to Credible, and fix the common connection errors
Credible connects to any PostgreSQL database reachable over the public internet.
Connection Fields
Fill in either the individual fields or a connection string, not both. The form disables the individual fields when a connection string is present.
| Field | Example |
|---|---|
| Host | db.example.com |
| Port | 5432 |
| Database Name | postgres |
| Username | credible_readonly |
| Password | your database password |
A connection string takes the standard PostgreSQL URI form:
postgresql://user:password@host:5432/databaseIf your password contains @, /, : or #, URL-encode it or the connection string will not parse correctly.
Optional Settings
| Setting | What it does |
|---|---|
| Database TLS | How the connection is encrypted. Applies to the individual fields only. A connection string sets its own sslmode; without one, the connection is not encrypted, so add ?sslmode=verify-full, or ?sslmode=no-verify for a server signed by a private authority. |
| Statement timeout (ms) | The database cancels any query that runs longer, including materialized-table builds. At least 1000; 300000 is 5 minutes. Leave it empty to use the database's own limit. Through a transaction-mode pooler (PgBouncer, or Supabase's port 6543) it may not apply. |
The Database TLS options:
| Option | Encrypted | Certificate checked |
|---|---|---|
| Server default | Yes, required | Yes: trusted authority, and issued for this host |
| Encrypt, skip certificate check | Yes | No |
| Encrypt + verify CA | Yes | Signed by an Amazon RDS authority, or one support has added. The hostname is not checked |
| Encrypt + verify CA and hostname | Yes | Trusted authority, and issued for this host |
| No encryption | No | No |
Server default behaves like Encrypt + verify CA and hostname. A server whose certificate is signed by a private authority, such as Supabase or most self-hosted Postgres, fails it. Choose Encrypt, skip certificate check for those: it works with almost every managed Postgres.
Both verify options trust Amazon RDS certificates already. Encrypt + verify CA and hostname also accepts a certificate from a public authority; Encrypt + verify CA does not, so choose the hostname option for one. For a server signed by a private authority, the verify options need that authority's public certificate to be trusted on Credible's side. Contact support to set that up. Until it is in place, choose Encrypt, skip certificate check to keep the connection encrypted.
When you connect through an SSH bastion, TLS is set in the bastion settings instead, as Database TLS (through the tunnel). Its default is Encrypt, skip certificate check, because the certificate is issued for the database host rather than the tunnel.
Network Access
Credible queries your database from stable egress addresses over IPv4, so the host you give it needs to be reachable from the public internet on an IPv4 address.
- Behind an IP allowlist? Add Credible's egress addresses to it. These depend on where your organization runs: contact support for yours.
- No public route at all? Use the Connect through an SSH bastion option in the connection form.
- Host published only on IPv6? It cannot be reached. Most managed Postgres offers an IPv4 endpoint alongside it. On Supabase, that is the session pooler.
From the CLI
To add the connection with cred add connection, put an entry like this in the JSON file:
[
{
"name": "warehouse",
"type": "postgres",
"postgresConnection": {
"host": "db.example.com",
"port": 5432,
"databaseName": "postgres",
"userName": "credible_readonly",
"password": "..."
}
}
]Use connectionString in place of the individual fields if you prefer. Database TLS is sslmode: no-verify (Encrypt, skip certificate check), verify-ca (Encrypt + verify CA), verify-full (Encrypt + verify CA and hostname) or disable (No encryption). Leave it out for Server default. Statement timeout (ms) is statementTimeoutMilliseconds. An SSH bastion goes in a proxy object beside postgresConnection: "type": "ssh" and an ssh object with host, port, username, privateKey (the PEM key as a string), and optionally privateKeyPass and hostKey.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
self signed certificate in certificate chain | The database's certificate is signed by a private certificate authority, not a public one. Common on Supabase with Enforce SSL enabled, and on self-hosted Postgres. | Set Database TLS to Encrypt, skip certificate check. With a connection string, append ?sslmode=no-verify |
connect ECONNREFUSED <ipv6 address> | The host resolves only to IPv6, which Credible cannot reach. | Use an IPv4-reachable host. On Supabase, the session pooler. |
connection timed out / ETIMEDOUT | The database is not reachable from the public internet, or an IP allowlist is blocking Credible. | Add Credible's egress addresses to the allowlist (see Network Access), or connect through an SSH bastion |
canceling statement due to statement timeout | The query ran longer than the connection's Statement timeout, or than a limit the database sets itself. | Raise the timeout. If the field is empty, the limit comes from the database itself, for example ALTER ROLE ... SET statement_timeout |
too many connections for role "<role>" | Credible's sessions, plus any other client using the same role, reached the role's CONNECTION LIMIT. | Raise the role's CONNECTION LIMIT, or give Credible its own role |
The server does not support SSL connections | The server has TLS turned off, and Server default requires it. Common on self-hosted Postgres. | Turn on TLS on the server, or set Database TLS to No encryption |
permission denied for schema ... | The credentials work but the role lacks read access. | Grant the role USAGE on the schema and SELECT on the tables you want to model |