pgprolog
pgprolog · PostgreSQL procedural language handler for Prolog, embedding Scryer Prolog.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100714 | pgprolog | pgprolog | 0.0.0 | LANG | BSD-3-Clause | Rust |
PostgreSQL · 11, 12, 13, 14, 15, 16
Usage
Sources:
pgprolog is a proof-of-concept procedural-language handler that embeds Scryer Prolog in PostgreSQL. It lets a function body contain Prolog facts plus a handle/2 predicate, but upstream explicitly says it is not ready for actual use.
Minimal Workflow
Extension installation is superuser-only. The language is not created automatically, so create plprolog with the installed handler before defining a function.
The published example demonstrates text input and text output. The project does not document a production type-mapping matrix, trigger support, set-returning functions, transaction/SPI access, modules, persistent Prolog state, or resource controls.
Trust and Prototype Boundaries
CREATE LANGUAGE without TRUSTED creates an untrusted language, so only superusers may create functions in it. Keep it untrusted: arbitrary Prolog programs execute a young embedded runtime inside a PostgreSQL backend, and parser, allocation, recursion, or panic defects can terminate or exhaust that backend.
Version 0.0.0 pins pgrx 0.11.3 and Scryer Prolog 0.9.4; advertised Cargo features stop at PostgreSQL 16. Use only in an isolated lab with statement and process limits. Before any further adoption, the handler needs explicit type/error semantics, cancellation tests, memory and recursion bounds, privilege review, fuzzing, crash isolation, and a maintained compatibility policy.