In most small companies, the database knows the answer and an engineer is the only way to ask it. How many orders shipped late? Which subscriptions are stuck? What did refunds look like in October? Each one is a message to an engineer, who stops what they're doing, writes a query and pastes the result back. Multiply by a dozen a week.
An AI connected to Postgres can answer most of these in plain English, and show the SQL it ran. The trick is doing it so engineering stays in control: one role it sets up, views it chooses, questions asked where everyone can see them, and a clear line for what still goes to an engineer.
Here's who does what, three prompts, and how a subscription company handles a week of data questions.
Who does what
Who does what
Set the ground rules
- One role, set by engineering. The AI connects with a role that can only read chosen views. Our read-only access guide has the SQL.
- Ask in the open. Questions in a shared channel mean everyone sees the answers, and the same question isn't asked five times.
- SQL always visible. Every answer shows the query, so anyone can check the table and filter.
- Agree the definitions. Write down what "active subscriber" and "revenue" mean, and which table holds them.
- Know when to escalate. Tables the AI can't see, numbers going outside the company, and anything that changes data go to an engineer.
Do it in Claude or ChatGPT
Connect Postgres with our guide to PostgreSQL in Claude, ChatGPT and MCP, using the read-only role. All three prompts only read.
A support question.
Using Postgres, how many orders shipped late this week, by warehouse, compared with last week? Show the SQL you ran. Don't change anything.
Copy promptAn operations question.
Which subscriptions have been in pending_activation for more than 3 days? List them with the plan and signup date, and show the SQL. Don't change anything.
Copy promptA finance question.
Total refunds in October by reason, against September. Show the SQL, and say which table and columns you used for the amount. Don't change anything.
Copy promptA few things to know:
- Check numbers that matter. A wrong join looks as confident as a right one. Compare totals with another source before they go in a report.
- Ask for shorter periods. A quarter at a time is more likely to stay inside the time limit. Two years at once may not.
- Save the good ones. A question asked every week deserves an approved query.
- Name the table. Asking for "refunds from the refunds table" beats hoping the AI picks the right one.
When the whole company asks
On your own, you'd ask your own questions. In a company, Sol's support team, Wren in operations and Marin in finance all ask, and Rowan, the engineering lead, wants to see what's being asked and keep the answers consistent.
Thimble & Co, a 45-person craft supplies subscription company in Portland, asks its data questions in BlueNexus. Postgres is connected with the read-only role on a replica, and questions go in one shared channel. Every Friday at 15:00, the data agent sums up the week's questions, flags answers that need checking, and suggests which to save.
Illustration of the BlueNexus app with example data.
Illustration of the BlueNexus app with example data.
Thirteen questions were answered without an engineer. Finance's refund total is 2% under the payment provider's, and one question needs a table the AI can't read. The agent prepares the next steps for Rowan.
Rowan approves. Marin finds the gap is refunds still pending at the provider, and adds a note to the saved query. Rowan plans a payouts view without bank details.
For Rowan, the engineering lead. From Postgres and the data questions channel. Nothing is posted or saved until Rowan approves it.
- Save the 3 most-asked questions as approved queriesIn the Data project, with their SQL, so answers stay consistent
- Post the weekly digest in the data questions channelQuestions, answers and the SQL behind each
- Ask Marin to compare October refunds with the providerThe 2% gap may be refunds still pending
- Give the AI access to partner payoutsLeft unticked: Rowan decides, with a view that hides bank details
Illustration of the BlueNexus app with example data.
For connecting Postgres, see PostgreSQL in Claude, ChatGPT and MCP. For setup, see how to give AI read-only access to Postgres. To let your whole team ask data questions, sign up for BlueNexus.