pg_ai_query
AI-powered SQL query generation for PostgreSQL
pg_ai_query : AI-powered SQL query generation for PostgreSQL
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2720 | pg_ai_query | pg_ai_query | 0.1.1 |
FEAT | Apache-2.0 | C++ |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.1.1 |
18 17 16 15 14 | pg_ai_query |
- |
| RPM | PIGSTY | 0.1.1 |
18 17 16 15 14 | pg_ai_query_$v |
- |
| DEB | PIGSTY | 0.1.1 |
18 17 16 15 14 | postgresql-$v-ai-query |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | N/A | N/A | N/A | N/A | N/A |
| el8.aarch64 | N/A | N/A | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| el9.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| el10.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| el10.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| d12.x86_64 | N/A | N/A | N/A | N/A | N/A |
| d12.aarch64 | N/A | N/A | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| d13.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| u22.x86_64 | N/A | N/A | N/A | N/A | N/A |
| u22.aarch64 | N/A | N/A | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| u24.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| u26.x86_64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
| u26.aarch64 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 | PIGSTY 0.1.1 |
Source
github.com/benodiwal/pg_ai_query
pg_ai_query-0.1.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
pg_ai_query generates SQL queries from natural language descriptions using LLM providers (OpenAI, Anthropic, Google Gemini). It introspects your database schema and translates plain-English questions into SQL.
Configuration
Create ~/.pg_ai.config:
Query Generation
Schema Discovery
Query Explanation
Pass API credentials directly:
Supported Models
- OpenAI: gpt-4o, gpt-4o-mini
- Anthropic: claude-3-5-sonnet-20241022, claude-3-haiku-20240307
- Google Gemini: gemini-2.5-pro, gemini-2.5-flash