pg_pageindex
PageIndex document-tree construction and tree search for PDF and Markdown through a C/Go bridge.
pg_pageindex · PageIndex document-tree construction and tree search for PDF and Markdown through a C/Go bridge.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101079 | pg_pageindex | pg_pageindex | 1.0 | RAG | MIT | C |
PostgreSQL · 16
Usage
Sources:
pg_pageindex 1.0 runs the PageIndex document-tree pipeline inside a PostgreSQL backend. It reads server-side PDF or Markdown files, returns JSON documents, and can call language models for summaries and tree search.
Harden installation first
The install SQL grants function execution to public by default. Revoke it in the same transaction, then grant only the functions a dedicated trusted role needs:
After explicit grants, a trusted role can build from an approved server path:
Caveats
- Paths are resolved on the database server and read with the PostgreSQL operating-system account. Never accept client-controlled paths; upstream equates that trust boundary with dangerous server-side program execution.
- PDF parsing and the Go, MuPDF, and PageIndex bridge run inside the calling backend. Malformed or very large documents can consume memory and CPU, raise errors, or crash the backend.
- Summary, description, and search operations can make blocking outbound requests to configured OpenAI-compatible or Anthropic endpoints. Document text, structure, prompts, and queries may leave the database host.
- Keep API keys outside SQL and database tables, restrict outbound networking, set statement and network timeouts, and review provider retention policy.
- The extension returns JSON rather than managing indexed rows. It does not create a PostgreSQL index access method or make arbitrary table queries faster.