Your PostgreSQL database holds the answers to every business question your team is asking and almost nobody on your team can get those answers without filing a ticket with an engineer. That is not a data problem. It is an access problem. And in 2026, it is entirely solvable.
This guide shows you exactly how to connect PostgreSQL to AI for Database and start asking questions in plain English the same day, no SQL required, no data warehouse, no third-party ETL pipeline.
-
Why PostgreSQL Is the World's Best Database and the Worst Analytics Tool
PostgreSQL is the most widely deployed open-source relational database on the planet. GitHub, Notion, Shopify, and thousands of SaaS companies run on it. It handles billions of rows, supports JSON, full-text search, geospatial queries, and has a thriving extension ecosystem. For developers, it is close to perfect.
For a product manager who wants to know "how many users churned last month, and what plan were they on?" it is a wall.
Here is the gap: PostgreSQL was designed for engineers. Writing a meaningful analytics query requires knowing table schemas, join logic, aggregation syntax, window functions, and often nested subqueries. The average non-technical stakeholder cannot write SELECT plan, COUNT(*) FROM subscriptions WHERE status = 'churned' AND churned_at >= NOW() - INTERVAL '30 days' GROUP BY plan ORDER BY COUNT(*) DESC and they should not have to. Their job is to ask the question, not to know which tables store the answer.
The traditional workarounds each have a serious cost:
Dedicated BI tool (Metabase, Redash, Tableau): These require someone to build and maintain dashboards in advance. If the CEO asks a question that is not already on a dashboard, you are back to filing a ticket.
Data warehouse (BigQuery, Snowflake, Redshift): Moving data out of PostgreSQL into a warehouse adds latency, cost, and a maintenance burden. For many small and mid-size teams, it is massive overkill.
Training non-technical staff to use SQL: Possible. Takes months. And SQL is not a natural interface for people who think in business terms, not schema terms.
AI for Database is a fourth path. You connect your live PostgreSQL database, ask questions in plain English, and get answers instantly with no intermediate infrastructure, no pre-built dashboards, and no SQL knowledge required. The rest of this article walks through exactly how it works.
-
How to Connect PostgreSQL to AI for Database (Step-by-Step)
Connecting your PostgreSQL instance takes under five minutes. Here is the exact process:
Step 1: Create your account
Go to https://app.aifordatabase.com/signup and create a free account. No credit card is required to start.
Step 2: Add a new database connection
From the dashboard, click "Add Connection" and select PostgreSQL as your database type.
Step 3: Enter your connection details
You will need the following credentials from your PostgreSQL instance:
db.mycompany.com or a Supabase host like db.xxxx.supabase.co)5432A note on security: AI for Database connects with read-only queries. You can create a dedicated read-only PostgreSQL user specifically for analytics access this is good practice regardless of which tool you use.
To create a read-only user in PostgreSQL:
CREATE USER analytics_user WITH PASSWORD 'your_secure_password';
GRANT CONNECT ON DATABASE your_database TO analytics_user;
GRANT USAGE ON SCHEMA public TO analytics_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO analytics_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO analytics_user;Step 4: Test the connection
Click "Test Connection." AI for Database will verify the credentials and show you the tables it has discovered in your database.
Step 5: Let AI for Database index your schema
On first connection, the system reads your table names, column names, and data types. It does not read your data just the structure. This schema indexing is what allows it to translate plain-English questions into accurate SQL behind the scenes.
You are now ready to ask your first question.
-
10 Natural Language Queries for Common PostgreSQL Use Cases
Once connected, you type questions the same way you would ask a colleague. Here are ten examples organized by common PostgreSQL use case, showing what you type and what kind of SQL gets generated behind the scenes.
SaaS Metrics
Query 1: "How many new users signed up each day over the last 30 days?"
This generates a date-grouped count against your users table, filtered by created_at. A query that takes a developer 10 minutes to write correctly takes you 10 seconds to ask.
Query 2: "What is the month-over-month revenue growth for the last 6 months?"
This computes MoM growth using window functions one of the trickier SQL constructs. You ask it in plain English and get a clean table: month, revenue, and percentage change.
Query 3: "Show me the top 10 accounts by MRR and what plan they are on."
A join between your subscriptions and accounts tables with an ORDER BY. The AI knows which tables to join because it has indexed your schema.
E-Commerce
Query 4: "What are the top 5 products by revenue this quarter?"
Joins your orders and products tables, filters by the current quarter's date range, and sums order values grouped by product.
Query 5: "Which customers have placed more than 3 orders but not purchased in the last 60 days?"
This is a real churn-risk query. It involves a HAVING clause and a date filter exactly the kind of query that would normally require a developer.
Query 6: "What is the average order value by country?"
A GROUP BY on a geography column with an average aggregation. Useful for pricing and localization decisions.
User Analytics
Query 7: "What percentage of users who signed up last month are still active today?"
This computes a retention ratio: active users from a cohort divided by total signups in that cohort. A window function problem that most SQL-literate analysts would need 15 minutes to write correctly.
Query 8: "Show me a breakdown of user roles across all active accounts."
A simple GROUP BY with a COUNT but if you do not know your schema, you do not know which table to query or what the role column is called.
Operations
Query 9: "How many support tickets were opened vs. closed each week for the last 8 weeks?"
A pivoted weekly summary that requires conditional aggregation SUM(CASE WHEN status = 'open' THEN 1 END) and similar. Plain English in, clean table out.
Query 10: "List all users who have not logged in for more than 90 days but still have an active subscription."
A churn-risk filter combining last_login_at and subscription status. One sentence to you; one complex JOIN to the AI.
Every one of these queries works against your live PostgreSQL data. You are not querying a cached copy or a synced replica. You get current results, every time.
-
Building a Live PostgreSQL Dashboard
Asking one-off questions is powerful. Building a dashboard turns those questions into persistent, self-refreshing views that your whole team can use without anyone needing to log in and re-run queries.
How it works:
Once you have run a query and like the result, you can pin it to a dashboard. AI for Database renders it as a chart (bar, line, pie, table your choice) and adds it to a dashboard view that anyone on your team can access via a shared link.
The key difference from tools like Metabase or Looker is the refresh model. Instead of someone re-running queries manually, you set a refresh interval every hour, every 4 hours, daily. The dashboard pulls fresh data from your PostgreSQL database on that schedule, automatically.
A practical example:
Say you are running a SaaS product on PostgreSQL. You want a dashboard that shows:
You can build this entire dashboard in under 20 minutes by asking each question in plain English, choosing a chart type, and pinning it. No SQL. No dashboard tool configuration. No asking a developer.
Once pinned and refresh intervals are set, this dashboard runs itself. Your CEO can bookmark the URL and check it every morning without any engineering involvement.
Sharing the dashboard:
Dashboards can be shared with team members. Anyone with access to the link can view current data but they cannot modify the underlying queries unless they have the appropriate permissions.
-
Setting Up Workflow Alerts on PostgreSQL Data
Dashboards tell you what is happening. Workflow alerts tell you when something specific happens so you do not have to watch dashboards all day.
AI for Database lets you define conditions in plain English and trigger actions when those conditions are met. For PostgreSQL specifically, some high-value alert scenarios:
Alert examples:
Setting up an alert:
The system translates your condition into a SQL query that runs on the schedule you set. If the result meets the condition (e.g., count drops below threshold), the action fires.
This is operationally significant. Most PostgreSQL-backed businesses either build custom alerting scripts (expensive to maintain) or check dashboards manually (unreliable). Workflow alerts close that gap without any custom code.
-
PostgreSQL-Specific Considerations: What Makes This Database Different
PostgreSQL has characteristics that set it apart from other databases, and understanding them helps you get the most out of AI for Database.
Schema-aware querying
One of PostgreSQL's strengths is its support for schemas beyond the default public schema. Many production PostgreSQL databases use multiple schemas to organize tables for example, an app schema for product tables and an analytics schema for pre-aggregated data. AI for Database indexes all schemas in your database, not just public. When you ask a question, it will search across schemas for the most relevant tables. If your database uses custom schemas, you may want to specify the schema in your question for more accurate results: "from the analytics schema, show me weekly active users."
JSON and JSONB columns
PostgreSQL's JSONB support is a major reason many SaaS companies choose it. Event tables often store properties as JSONB, user profile tables store preferences as JSONB, and feature flags are commonly stored as JSONB. AI for Database can query JSONB columns for example, "show me users where properties->>'plan' is 'enterprise'" though deeply nested JSONB structures may require more precise question phrasing than flat column queries.
PostGIS and geospatial data
If your PostgreSQL instance uses the PostGIS extension for geographic data, be aware that AI for Database focuses on standard SQL queries. Geospatial distance calculations and spatial joins are outside the current scope of natural language querying.
Indexes and query performance
AI for Database generates efficient SQL it uses WHERE clauses, date range filters, and GROUP BY aggregations that align with common index patterns. However, query performance depends on your PostgreSQL indexes, not on the analytics tool. If you are running queries against a large unindexed table, they will be slow regardless of which tool executes them. Standard PostgreSQL indexing practices (index columns used in WHERE clauses and JOIN conditions) apply.
Supabase-specific notes
Many teams use AI for Database specifically to query Supabase databases. Supabase runs PostgreSQL under the hood and exposes standard connection credentials. When connecting via Supabase, use the "Direct connection" credentials from your Supabase project settings (not the pooled connection string) for best compatibility. Supabase databases often include Supabase-internal tables alongside your application tables AI for Database's schema index will include all of them, but it is smart about context and will prioritize your application tables when answering business questions.
-
Who Is Already Using This Approach
To make this concrete, here are the types of teams that benefit most from natural language PostgreSQL analytics and what they use it for.
Early-stage SaaS founders: A founder running a SaaS product on Supabase or Heroku Postgres spends an hour a week pulling metrics manually new signups, churned users, MRR, trial-to-paid conversion. With AI for Database, they connect once and build a dashboard that tracks all of these automatically. They reclaim that hour and their CEO stops getting "I'll check the database" as an answer to basic questions.
Product managers at growth-stage companies: Product managers need data to make prioritization decisions. The question is not whether they should be data-driven it is whether they can get the data without a 3-day engineering turnaround. With a direct PostgreSQL connection, a PM can ask "which feature did users engage with most in the first 7 days?" and get an answer in seconds, not days.
Operations and customer success teams: Operations teams track fulfillment metrics, ticket volume, and SLA compliance. Customer success teams track account health, product usage, and renewal risk. Both groups have questions that require database access but do not have SQL skills. AI for Database gives them a self-service path to the data they need.
Small data teams serving large organizations: A single data analyst supporting a 50-person organization cannot be a bottleneck for every data question. By giving business teams direct access to a natural language query interface, the analyst can focus on complex modeling and strategic analysis instead of pulling one-off numbers all day.
-
PostgreSQL Analytics Tools Compared
Here is an honest comparison of the tools commonly used for PostgreSQL analytics, including where each one makes sense.
Tool | Natural Language Queries | Dashboards | Workflow Alerts | Requires SQL Knowledge | Self-Hosted Option | Free Tier | Price (Team)
AI for Database | Yes | Yes (auto-refresh) | Yes | No | No | Yes | Low
Metabase | No | Yes | No | Yes (for custom) | Yes | Yes (OSS) | $500+/mo (Cloud)
Redash | No | Yes | No | Yes | Yes | Yes (OSS) | Free (OSS)
PopSQL | No | Limited | No | Yes | No | Yes (limited) | ~$50+/user/mo
pgAdmin | No | No | No | Yes | Yes | Yes | Free
Grafana | No | Yes | Yes (monitoring) | Yes | Yes | Yes | Variable
Tableau | Partial (Ask Data) | Yes | Limited | Partial | No | No | $75+/user/mo
When to use each:
-
Start Querying Your PostgreSQL Database Today
If your PostgreSQL database holds the answers your team needs but those answers are locked behind a SQL barrier, the fix is a five-minute setup not a data warehouse project.
AI for Database connects directly to your live PostgreSQL instance, understands your schema, and lets anyone on your team ask questions in plain English. No SQL. No pre-built dashboards. No waiting for an engineer.
Connect your PostgreSQL database for free at https://app.aifordatabase.com/signup.