Connecting PostgreSQL

Greppilot allows you to connect to your PostgreSQL database to enable AI-powered analytics, data exploration, and automated reporting.

AI generating a revenue chart from PostgreSQL data

Configuration

To connect Greppilot to your PostgreSQL database:

  1. Navigate to the Integrations section in your Greppilot dashboard.
  2. Select PostgreSQL from the list of available integrations.
  3. Provide your database Connection String.

Greppilot stores your connection string securely using industry-standard encryption. All queries executed against your database by Greppilot are read-only (SELECT statements only).

Connection String Format

The connection string must be a valid URL. Greppilot supports the postgres:// and postgresql:// protocols.

Example Connection String:

postgres://user:password@host:5432/database
ParameterDescription
userThe database username.
passwordThe database password.
hostThe database server hostname or IP address.
portThe database server port (default is 5432 for PostgreSQL).
databaseThe name of the database to connect to.

Connection Validation

Greppilot performs validation checks on your connection string during configuration:

  • URL Format: Ensures the string is a valid URL (e.g., postgres://user:pass@host/db).
  • Protocol: Only postgres and postgresql protocols are supported for PostgreSQL connections. Other supported database types include mysql, clickhouse, and mssql.
  • Hostname: Blocks connections to reserved IP ranges or cloud metadata endpoints (e.g., 169.254.x.x or hostnames containing metadata).

Available Actions

Once connected, Greppilot's AI agent can perform the following actions on your PostgreSQL database:

Query Your Data

Once connected, simply ask the agent questions in plain English. The agent automatically uses your database schema to construct accurate SQL queries.

Example prompts:

  • "Show me the total revenue for the last month from the orders table."
  • "What are the top 10 customers by lifetime value?"
  • "Compare monthly signups this year vs last year."

View Your Schema

The agent automatically introspects your database schema when you connect. You can ask it what's available:

  • "What tables are in my database?"
  • "What columns does the orders table have?"

Refresh Schema

If your database schema changes (new tables, modified columns), ask the agent to update its understanding:

  • "Refresh the schema for my database."

The agent remembers your schema across conversations, so you only need to refresh when your database structure changes.