https://github.com/tada/pljava/
PL/Java
is a free, open-source extension for PostgreSQL that allows stored
procedures, triggers, and functions to be written in the Java language and
executed in the backend. It installs two language handlers:
java (permissions controlled with GRANT/REVOKE) and
javau (unrestricted, superuser only).
The PostgreSQL RPM repository uses PostgreSQL version numbers in the RPM packages. For example pljava for PostgreSQL 18 is named as pljava_18. Similarly pljava for PostgreSQL 17 is named as pljava_17.
Install PGDG repository from: https://zypp.postgresql.org/repopackages/
| OS | Command |
|---|---|
| SuSE Enterprise Linux 15 / 16, OpenSuSE Leap 16.0 | zypper install pljava_18 (or change the version as described above) |
pljava almost always needs the pljava.libjvm_location GUC to be
set to the full path of your JVM's libjvm.so (its location
varies by JDK vendor and platform), for example:
SET pljava.libjvm_location TO '/path/to/libjvm.so';
Connect to the database that you want to create the extension as superuser and run:
CREATE EXTENSION pljava;
This installs both the java and javau languages.
Grant non-superusers access to the restricted language with:
GRANT USAGE ON LANGUAGE java TO myuser;
| PostgreSQL version(s) | OS version | Arch | Status |
|---|---|---|---|
| 18,17,16,15,14 | SuSE Enterprise Linux 16 | x86_64 | Available |
| 18,17,16,15,14 | OpenSuSE Leap 16.0 | x86_64 | Available |
| 18,17,16,15,14 | SuSE Enterprise Linux 15 | x86_64 | Available |