rpc
rpc · Synchronous JSON-to-JSON RPC client for PostgreSQL over a Unix domain socket, with a companion Go server example
Overview
Usage
Sources:
- Upstream README at the reviewed commit
- Version 1.0 SQL declaration
- Unix-socket C client
- Extension control file
rpc sends a JSON document to a Unix-domain socket and returns the JSON document sent back by the peer. Each frame is prefixed by a big-endian 32-bit length.
The default socket is /var/run/postgresql/rpc.sock; both rpc.path and the zero-to-sixty-second rpc.timeout are user-settable. The peer must implement the exact framing protocol and return valid JSON.
Version 1.0 is a small old native client with no authentication, authorization, release history, tests, or compatibility matrix. Any function caller can select another accessible Unix socket. The response length supplied by the peer drives an unchecked memory allocation, so a malicious peer can exhaust a backend. Revoke public execution and setting privileges, constrain filesystem access, and use only with a trusted local service.