pg_gen_query
A PostgreSQL extension written in C++ that adds no-maintenance GenAI querying functionality using Clickhouse’s AI SDK
pg_gen_query · A PostgreSQL extension written in C++ that adds no-maintenance GenAI querying functionality using Clickhouse’s AI SDK
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101546 | pg_gen_query | pg_gen_query | 1.0 | RAG | MIT | C++ |
Usage
Sources:
- Official upstream README
- Official extension control file (pg_gen_query.control)
- Official extension SQL (pg_gen_query–1.0.sql)
pg_gen_query — This PostgreSQL extension provides a function, pg_gen_query, that converts natural language input into an equivalent SQL command. Use it for the corresponding vector, model, or retrieval workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
pg_gen_query(query text)is an extension function and returnsTEXT.regen_schema_cache()is an extension function and returnsvoid.regen_schema_cache_trigger()is an extension function and returnsevent_trigger.
Requirements and Caveats
- The reviewed control file declares default version
1.0. - The control file marks the extension as relocatable.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.