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
| Field | Example | Required |
|---|---|---|
| Host | db.example.com | Yes |
| Port | 5432 | Yes |
| Database | analytics | Yes |
| Username | gradientharbor_reader | Yes |
| Password | •••••••• | Yes |
| SSL CA Certificate | PEM-encoded certificate | No |
Setup Steps
- Go to Administration > DB Connectors
- Click Add Connector and select PostgreSQL
- Enter your connection details
- Click Test Connection — GradientHarbor will verify the credentials
- Once verified, the connector starts initial introspection automatically
- After introspection, select the schemas you want to catalog
- Full catalog sync begins for the selected schemas
Recommended Database User
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):
- Obtain the CA certificate from your database provider
- Paste the PEM-encoded certificate into the SSL CA Certificate field
- 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
| Issue | Solution |
|---|---|
| Connection timeout | Verify the host is reachable. Check firewall rules and security groups. |
| Authentication failed | Verify username and password. Ensure the user exists and has the correct privileges. |
| Permission denied for schema | Grant USAGE on the schema and SELECT on the tables to the database user. |
| SSL required | Add the CA certificate in the connector configuration. |