Skip to content

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

IDExtensionPackageVersionCategoryLicenseLanguage
101546pg_gen_querypg_gen_query1.0RAGMITC++

Usage

Sources:

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

CREATE EXTENSION pg_gen_query;

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 returns TEXT.
  • regen_schema_cache() is an extension function and returns void.
  • regen_schema_cache_trigger() is an extension function and returns event_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.

Table reader