pg_uprobe
pg_uprobe · Session tracing and dynamic probes for PostgreSQL internals
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102190 | pg_uprobe | pg_uprobe | 0.3 | STAT | AGPL-3.0-only | C |
PostgreSQL · 15, 16, 17
Usage
Sources:
pg_uprobe captures query text, plans, per-node execution, waits and locks, and profiles native functions through Frida Gum. Upstream lists PostgreSQL 15–17, Linux and FreeBSD; ARM64 is not tested.
Core Workflow
Operational Boundaries
Preload the library and restart before creating the extension as a superuser. start_session_trace() and stop_session_trace() delimit a trace. set_uprobe() installs TIME, HIST or MEM probes; list_uprobes() and delete_uprobe() manage them. Native targets must be exported, non-static, non-inline functions. pg_uprobe.data_dir defaults to the server data directory subfolder, and pg_uprobe.trace_file_limit limits trace files. Protect those files because they include query text and plans. Tracing adds overhead and is intended for focused investigations.