pg_iroh
pg-iroh · Supervise an Iroh transport helper for PostgreSQL connections
Overview
PostgreSQL · 16, 17, 18
Usage
Sources:
- README.md
- pg_iroh.control
- sql/pg_iroh–0.1.3.sql
- docs/configuration.md
- docs/authentication-operations.md
- docs/relay-metrics.md
- docs/releases.md
pg_iroh 0.1.3 supervises a Rust helper that carries PostgreSQL connections over Iroh. This is an experimental source revision without a published release. The main setup targets PostgreSQL18 on Linux/glibc; documented PG16/17 artifact smoke checks do not establish production qualification.
Enable the Transport
Provision the server key and a peer-policy file owned by the PostgreSQL OS user, with restrictive permissions. An empty peer policy admits nobody. Append the library to the existing preload list, configure the matching helper and restart PostgreSQL:
The optional SQL extension installs diagnostics; it does not enable the transport. A database superuser can install and inspect them:
Authentication and Operations
pg_iroh_ready() reports startup readiness, not continuous database or relay health. pg_iroh_stats() exposes availability, freshness, traffic and rejection counters; a sample older than three seconds is stale. Execution of readiness and statistics functions is revoked from PUBLIC. Grant diagnostics only to appropriate monitoring roles.
Iroh peer admission and PostgreSQL authentication are separate. Configure PostgreSQL TLS, database credentials and a matching pg_hba.conf rule; the documented helper source address is 127.0.0.2. A permitted peer still needs a permitted database login. Retain certificate verification when using a local forwarding client.
All pg_iroh.* settings are administrator-only startup settings and require restart. The helper runs with the database OS account’s privileges and is not a sandbox. Replace module and helper together during upgrades; protect and back up identity and policy files. Interrupted database sessions are errors to handle explicitly, not automatically retried SQL.