Last updated: 4 July 2026

PostgreSQL

PostgreSQL

Live
Auth: DB credentials · Plans: Business, Enterprise · Tools: 5 · Category: Database

Query your PostgreSQL database in plain English — the AI writes the SQL, you get the answer.

Who needs this: Any business with custom applications or internal tools that store data in PostgreSQL.

Example questions once connected

  • How many orders came in last week?
  • Show me the top 10 customers by revenue this month
  • Which products are below reorder level?
  • What is the average order value by city?
⚠️

Create a dedicated read-only user. Do NOT connect with your admin account. Ask your developer to run: CREATE USER msharti_read WITH PASSWORD 'your-secure-password'; GRANT SELECT ON ALL TABLES IN SCHEMA public TO msharti_read;

Step-by-step setup

  1. Gather connection details. Ask your developer for: Host (e.g. db.yourcompany.com), Port (5432), Database name, Username, Password.
  2. Connect in Msharti. Go to Connectors → PostgreSQL → Set Up. Fill in all fields. Toggle SSL on if required. Click Test Connection.
  3. Confirm success. Msharti runs SELECT 1. "Connected — 3 tools active" means you are done.

Tool reference

These are the tools the AI can call on this connector. Each tool fires automatically when you ask a relevant question.

run_query() Execute a read-only SELECT query on the connected database. INSERT, UPDATE, DELETE are blocked at the gateway level.
Inputs natural language question (AI generates the SQL)
Try asking "Show me the top 5 products by revenue in May 2026"
Returns 1. Cement 32mm — KES 1.2M 2. Iron sheets — KES 890K 3. PVC piping — KES 620K 4. Paint (5L) — KES 410K 5. Roofing nails — KES 380K
list_tables() List all tables in the connected schema with row counts.
Inputs optional: schema name (defaults to public)
Try asking "What tables are in the database?"
Returns orders (14,832 rows), customers (3,201 rows), products (428 rows), suppliers (87 rows), stock_levels (428 rows)
describe_schema() Return column names, data types, and constraints for a specific table.
Inputs table_name
Try asking "Describe the orders table"
Returns id (serial PK), customer_id (FK→customers), created_at (timestamptz), status (varchar), total_kes (numeric), branch_code (varchar)

Limits

  • All queries are read-only. INSERT, UPDATE, DELETE, and DDL statements are blocked at the gateway even if the AI attempts them.
  • Maximum 500 rows returned per query. Results beyond the limit are truncated with a notice.
  • Query timeout: 30 seconds. Long-running analytical queries may need to be broken into smaller requests.
  • Connect with a dedicated read-only database user. Do not use your admin credentials.

Troubleshooting

ProblemCauseFix
Connection refused Wrong host/port, or firewall blocking Verify host and port. Ask IT to whitelist Msharti's IP.
Authentication failed Wrong username or password Verify credentials. Check the user exists and has a password.
SSL required Database enforces SSL Toggle SSL on in the Msharti form.
Need help? [email protected] — Nairobi-based, same time zone.