pgextmgr
pgextmgrext · pgrx extension manager and hook framework for registering, ordering, enabling, and disabling PostgreSQL extension plugins.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100836 | pgextmgr | pgextmgrext | 0.0.0 | ADMIN | MIT | Rust |
PostgreSQL · 15
Usage
Sources:
pgextmgr is an experimental pgrx hook manager that lets specially instrumented PostgreSQL extension plugins register ordered planner, executor, and query-rewriter callbacks. It can inspect those registrations and enable or disable a plugin at runtime. It is a prototype framework for compatible plugins, not a general manager for arbitrary installed extensions.
Core Workflow
The upstream test configuration preloads the manager and its instrumented plugins so their hooks are installed during server startup:
Restart PostgreSQL after changing shared_preload_libraries, then create pgextmgr and the plugins built for its ABI. Inspect their status and hook order before changing it:
pgextmgr.all() reports each registered plugin’s order and enabled/disabled state. pgextmgr.hooks() reports the ordered plugin chain for each supported hook. The state-changing functions return the number of affected registrations.
Function Index
pgextmgr.all()lists registered plugins and their current state.pgextmgr.hooks()lists the manager’s planner, executor, and rewriter callback order.pgextmgr.enable(text)andpgextmgr.disable(text)change one known plugin.pgextmgr.enable_all()andpgextmgr.disable_all()change every registered plugin.
Operational Notes
pgextmgr installs into the fixed pgextmgr schema and requires superuser privileges to create. The reviewed source targets the PostgreSQL 15-era pgrx environment. Its plugin quickstart uses custom linker flags and the framework’s __pgext_before_init and __pgext_after_init symbols; an ordinary extension that was not built for this ABI will not appear as a manageable plugin.
Enable/disable state is held in backend process memory rather than a durable catalog. Confirm behavior after reconnects and restarts, and test hook ordering and failure handling with the exact plugin set. The upstream README presents the framework as work in progress, so use it for controlled research rather than assuming production compatibility or stable APIs.