pgquerynarrative
pgquerynarrative · SQL integration with the external PgQueryNarrative investigation service
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102020 | pgquerynarrative | pgquerynarrative | 1.1 | FEAT | MIT | SQL |
PostgreSQL · 16, 17, 18
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
- docs/integrations/postgres-extension.md
- infra/postgres-extension/pgquerynarrative.control
- infra/postgres-extension/pgquerynarrative–1.1.sql
pgquerynarrative 1.1 calls a running PgQueryNarrative service from SQL. It is separate from the in-database investigation extension pqn.
Core Workflow
As a superuser, install the HTTP dependency before the wrapper and grant access to an existing role. Configure a reachable, trusted service endpoint.
API and Boundaries
pgquerynarrative_set_api_key sets each caller’s session credential. pgquerynarrative_run_query runs a read-only query through the service; pgquerynarrative_generate_report requests a report, and pgquerynarrative_list_saved lists saved queries. pgquerynarrative_revoke_access removes access.
Without http at install time, the extension creates pending-response functions rather than real HTTP calls. Adding the dependency later does not rewrite those functions automatically. Version 1.1 revokes function execution from PUBLIC; the owner controls the stored API URL. Statements containing API-key literals may enter query logs, and SQL is transmitted to the service. The server’s authorization and result limits still apply. PostgreSQL 16–18 is the documented service range; no preload is needed for these SQL wrappers.