pljvm
pljvm · A PostgreSQL procedural language that sends function calls over RPC to code running in an external JVM process.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100462 | pljvm | pljvm | 1.0.0 | LANG | BSD-3-Clause | C |
Usage
Sources:
- Project README
- Extension control file
- Version 1.0.0 installation SQL
- PostgreSQL call handler
- Java RPC service
pljvm 1.0.0 defines a PostgreSQL procedural language that sends function arguments over RPC to code in a separate JVM process, then deserializes the returned value. A function body names a Java class and method; the Java-side service loads the class, creates an instance, and invokes the public method.
Start the service and define a function
The Java class must be on the service classpath. In the reviewed source both sides use a fixed TCP endpoint at localhost:8000; the extension does not start or supervise the JVM service.
Security and implementation limits
Although the README describes a trusted execution engine, the installation SQL uses CREATE LANGUAGE pljvm without the TRUSTED keyword. PostgreSQL therefore treats it as an untrusted language, and function creation requires the corresponding elevated privilege. The reviewed RPC path has no configurable endpoint, authentication, or transport encryption; isolate the service and do not expose port 8000.
This snapshot is an early implementation: its C handler says triggers and multi-column results are unsupported, and the Java service uses older Netty/Maven dependencies. Treat JVM process lifecycle, classpath deployment, failure handling, resource limits, and exact PostgreSQL/JDK compatibility as operator responsibilities, and validate them before production use.