pg_ssh
Run remote commands over SSH from PostgreSQL (libssh2; in-memory private-key auth)
pg_ssh · Run remote commands over SSH from PostgreSQL (libssh2; in-memory private-key auth)
Overview
Usage
Sources:
- Official upstream README
- Official extension control file (pg_ssh.control)
- Official implementation source
pg_ssh — PostgreSQL 18 (13–17 also build via the pgXX features) Rust toolchain (stable) [cargo-pgrx][cpgrx] 0.19.1 — must match the pgrx crate version exactly System packages (Debian/Ubuntu):. Use it for the corresponding SQL or database utility workflow. Use the pinned upstream revision linked above as the API boundary and test it on the target PostgreSQL build.
Core Workflow
Install the extension in the intended database, run the smallest upstream example above when available, and verify the installed version and returned values before integrating it into application SQL.
Important Objects
execis an extension function.keygenis an extension function.session_closeis an extension function.session_execis an extension function.session_openis an extension function.sessions()is an extension function.
Requirements and Caveats
- The catalog records version
0.3.0. - The control file marks the extension as non-relocatable.
- The control file requires a superuser for installation.
- Confirm privileges, supported PostgreSQL versions, upgrade behavior, and failure cases against the pinned source before production use.