Connect PostgreSQL to clariBI
Query your Postgres tables and views in plain English. clariBI's AI engine turns your relational data into an interactive, self-serve analytics platform, no SQL expertise required.
Powered by psycopg2 via SQLAlchemy with connection pooling, Fernet-encrypted credentials, and 440+ ready-to-use analysis templates.
What is PostgreSQL?
PostgreSQL is an advanced open-source relational database management system (RDBMS) trusted by companies of every size, from early-stage startups to Fortune 500 enterprises. Known for its standards compliance, extensibility, and reliability, PostgreSQL handles transactional workloads, complex analytical queries, JSON documents, full-text search, and geospatial data through PostGIS.
Teams use PostgreSQL to store everything from user accounts and product catalogues to order histories, event logs, and financial records. Its rich feature set, including advanced indexing (B-tree, GIN, GiST), window functions, CTEs, and materialized views, makes it a popular choice for applications that need both transactional integrity and analytical depth.
clariBI connects to PostgreSQL using the psycopg2 driver (the most widely adopted Python PostgreSQL adapter), managed through SQLAlchemy with the postgresql+psycopg2 dialect. Once connected, clariBI introspects your schema automatically and makes every table and view available to clariBI's AI engine for natural-language querying, dashboard generation, and automated insight reports.
Unlike traditional BI tools that require you to write SQL or build data models by hand, clariBI lets any team member type a question, "What were our top 10 products by revenue last month?", and get an instant, chart-ready answer sourced directly from your PostgreSQL tables.
Learn more about PostgreSQL at postgresql.org →How to connect PostgreSQL to clariBI
The entire setup takes under five minutes. You will need network access from clariBI's servers to your PostgreSQL host on port 5432 (or your custom port).
Open Data Sources and click "Add Data Source"
From your clariBI workspace, navigate to Data Sources in the left sidebar. Click the + Add Data Source button in the top-right corner of the page. You'll see a categorised list of all supported integrations.
Select PostgreSQL from the database list
Under the Databases category, click the PostgreSQL tile. The connection form will open with fields for your host, port, database name, username, and password.
Enter your PostgreSQL connection details
Fill in the five required fields:
- Host - the hostname or IP address of your PostgreSQL server (e.g.
db.example.comor10.0.1.42) - Port - default is
5432; change only if your PostgreSQL instance uses a custom port - Database - the name of the PostgreSQL database you want to connect to (e.g.
myapp_production) - Username - a PostgreSQL user with
SELECTprivilege on the schemas you want to query - Password - stored with Fernet symmetric encryption; never stored in plaintext
Test the connection and confirm reachability
Click Test Connection. clariBI will attempt to open a psycopg2 connection via the SQLAlchemy postgresql+psycopg2 dialect. If it succeeds, you'll see a green confirmation banner. If it fails, clariBI will surface the specific error so you can diagnose firewall rules, pg_hba.conf settings, or credential issues quickly.
Browse your schema and start querying
clariBI will introspect all schemas accessible to your user and list every table and view. Choose which ones to include. From that moment, clariBI's AI engine can answer natural-language questions about your PostgreSQL data, generate dashboards, and surface automated insights using our 440+ built-in analysis templates across 30 business categories.
What you can analyze
Once connected, every table and view in your PostgreSQL database becomes a data source for clariBI's full suite of analytics features.
-
Plain-English queries across any table or view
Ask questions like "Show me monthly revenue by product category for 2024" without writing a line of SQL.
-
Multi-table joins resolved automatically
clariBI's AI engine understands foreign key relationships and constructs the correct JOIN logic on your behalf.
-
PostgreSQL-specific data types handled natively
TEXT, VARCHAR, INTEGER, NUMERIC, JSONB, ARRAY, TIMESTAMP WITH TIME ZONE, and UUID types are all supported and correctly represented in visualisations.
-
440+ pre-built analysis templates
Finance, operations, HR, sales, marketing: choose from 440+ templates across 30 business categories and apply them instantly to your PostgreSQL data.
-
Connection pooling with automatic recycling
A pool of 5 persistent connections with a max overflow of 10 and 1-hour connection recycling ensures high throughput without overloading your PostgreSQL server.
-
Automated dashboard generation from your schema
After connecting, clariBI can auto-generate a starter dashboard from your most important tables, ready to share with your team in seconds.
-
Scheduled reports and automated data refreshes
Configure sync intervals to keep dashboards current. Schedule email or Slack delivery of reports generated directly from PostgreSQL data.
-
Export results as PDF, CSV, or Excel
Download any chart, table, or full dashboard in multiple formats for offline sharing or stakeholder presentations.
Connection details
Reference these parameters when configuring your PostgreSQL connection in clariBI.
| Parameter | Value / Notes |
|---|---|
| Driver | psycopg2 via SQLAlchemy (postgresql+psycopg2 dialect) |
| Default port | 5432 |
| Required fields | host port database username password |
| Authentication | Username and password (md5 or scram-sha-256 supported) |
| Credential storage | Fernet symmetric encryption at rest; never stored in plaintext |
| Connection pool | Pool size: 5 • Max overflow: 10 • Connection recycle: 1 hour |
| Access model | Read-only credentials strongly recommended; table allow- and exclude-lists supported |
| Network requirement | clariBI servers must be able to reach your PostgreSQL host on the configured port; whitelist our IP ranges or use an SSH tunnel |
Use cases
PostgreSQL powers applications of every kind. clariBI makes the data inside those applications instantly accessible to every business team.
Sales & Revenue
Track orders, revenue by product line, average order value, and customer lifetime value across time periods. Ask "What is our monthly revenue trend for 2024?" and get an instant chart.
User Analytics
Analyze signups, churn rates, retention cohorts, and feature adoption from your application database. Build user funnels and segment analysis dashboards that update automatically.
Inventory Management
Monitor stock levels, reorder points, supplier lead times, and warehouse utilization. Set automated alerts when inventory falls below defined thresholds and share dashboards with procurement teams.
Financial Reporting
Generate P&L summaries, accounts receivable aging, expense breakdowns, and budget vs. actual comparisons. Schedule automated reports for monthly finance reviews without writing any SQL.
HR & Workforce
Visualize headcount trends, attrition rates, department budgets, and hiring pipeline metrics. Generate scheduled reports for executive review boards without any DBA involvement.
Operations & Logistics
Analyze delivery times, fulfilment rates, route efficiency, and service-level compliance. Bring together data from multiple schemas into unified operational dashboards updated on a schedule you define.
Security & requirements
Your data security is a top priority. Here is how clariBI protects your PostgreSQL connection and what you need to get started.
Security measures
-
Fernet encryption at rest
All PostgreSQL credentials (username, password) are encrypted using Fernet symmetric encryption before being stored in the clariBI database. The encryption key is managed separately from the data store.
-
SSL/TLS in transit
clariBI supports SSL connections to PostgreSQL. If your server requires SSL, the connection is negotiated automatically through the psycopg2 driver. We recommend enabling
sslmode=requireor higher for production environments. -
Read-only access recommended
Create a dedicated PostgreSQL user with only
SELECTprivileges on the schemas you want to query. clariBI never writes to your source database. -
Connection pooling with auto-recycle
Connections are pooled (max 5 + 10 overflow) and recycled after 1 hour to prevent stale connections and reduce load on your PostgreSQL server.
-
Audit logging
All queries executed against your PostgreSQL data source are logged in clariBI's audit trail, visible to workspace administrators at any time.
Prerequisites
-
PostgreSQL version
PostgreSQL 10 or later. Compatible with PostgreSQL 11, 12, 13, 14, 15, and 16. Also works with managed services like Amazon RDS, Google Cloud SQL, and Azure Database for PostgreSQL.
-
Network reachability
clariBI's servers must be able to reach your PostgreSQL host on port 5432 (or your custom port). You may need to add clariBI's IP ranges to your firewall allowlist, update
pg_hba.conf, or configure an SSH tunnel. -
Database name
You will need the exact name of the PostgreSQL database to connect to. You can find this by running
\lin psql or checking your application's configuration. -
No client-side software needed
clariBI's infrastructure includes the psycopg2 driver and all required libraries. No additional software needs to be installed on your end.
-
Dedicated analytics user
Create a dedicated PostgreSQL user (
CREATE USER claribi_ro WITH PASSWORD '...') and grantSELECTon the required schemas only.
Pricing & availability
PostgreSQL integration is included on all paid clariBI plans and the free 14-day trial. No extra fees, no per-query charges.
Annual billing saves up to 17% • All plans include unlimited dashboards, reports, and data source connections within your plan's limits • See full pricing details
Connect PostgreSQL in minutes
Start your free 14-day trial and have your first PostgreSQL-powered dashboard live today. No credit card required.
440+ analysis templates • Fernet-encrypted credentials • Connection pooling built in • All paid plans from $99/month