Skip to content

PostgreSQL

Connect GradientHarbor to your PostgreSQL database to enable AI-powered analytics and dashboard building.

Prerequisites

  • PostgreSQL 12 or later
  • A database user with read-only access to the schemas you want to analyze
  • Network access from GradientHarbor to your database (allow-list the GradientHarbor IP or use SSL)

Configuration

FieldExampleRequired
Hostdb.example.comYes
Port5432Yes
DatabaseanalyticsYes
Usernamegradientharbor_readerYes
Password••••••••Yes
SSL CA CertificatePEM-encoded certificateNo

Setup Steps

  1. Go to Administration > DB Connectors
  2. Click Add Connector and select PostgreSQL
  3. Enter your connection details
  4. Click Test Connection — GradientHarbor will verify the credentials
  5. Once verified, the connector starts initial introspection automatically
  6. After introspection, select the schemas you want to catalog
  7. Full catalog sync begins for the selected schemas

Create a dedicated read-only user for GradientHarbor:

sql
CREATE USER gradientharbor_reader WITH PASSWORD 'your_secure_password';

-- Grant access to specific schemas
GRANT USAGE ON SCHEMA public TO gradientharbor_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO gradientharbor_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO gradientharbor_reader;

WARNING

Avoid using a superuser or database owner account. GradientHarbor only needs read access to query your data.

SSL Configuration

If your database requires SSL (recommended for production):

  1. Obtain the CA certificate from your database provider
  2. Paste the PEM-encoded certificate into the SSL CA Certificate field
  3. GradientHarbor will use the certificate to establish a secure connection

For AWS RDS, download the RDS CA bundle.

For Google Cloud SQL, use the server CA certificate from the Cloud SQL instance details.

Troubleshooting

IssueSolution
Connection timeoutVerify the host is reachable. Check firewall rules and security groups.
Authentication failedVerify username and password. Ensure the user exists and has the correct privileges.
Permission denied for schemaGrant USAGE on the schema and SELECT on the tables to the database user.
SSL requiredAdd the CA certificate in the connector configuration.