Skip to content
Chapman Flack edited this page Oct 10, 2021 · 29 revisions

PL/Java

Welcome to PL/Java

If you have comments or ideas regarding this wiki, please convey them on the Mailing List. A great deal of information can also be found at the project information site.

Releases quick guide
1.6 series 1.5 series
Description Current recommended; for PostgreSQL 9.5 and later, Java 9 and later. Upgrades from the 1.5 series should be planned upgrades; please review the release notes 1.6.0 to current. Legacy support, for PostgreSQL back to 8.2, Java back to 6. Will not build with Java 15 or later. Can be used with 15 or later if built with an earlier JDK.
Latest 1.6.3 1.5.8

Important news

For implications of running on Java 17 and later, please see JEP 411.

Overview

PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, and Functions to the PostgreSQL™ backend. The development started late 2003 and the first release of PL/Java arrived in January 2005. The project is released under the PLJava License license.

Features

  • Ability to write functions, triggers, user-defined types, ... using recent Java versions. (To see the currently-targeted versions, please see the versions page.)
  • Standardized utilities (modeled after the SQL 2003 proposal) to install and maintain Java code in the database.
  • Standardized mappings of parameters and result. Supports scalar and composite user-defined types (UDTs), pseudo types, arrays, and sets.
  • An embedded, high performance JDBC driver utilizing the internal PostgreSQL SPI routines.
  • Metadata support for the JDBC driver. Both DatabaseMetaData and ResultSetMetaData are included.
  • Integration with PostgreSQL savepoints and exception handling.
  • Ability to use IN, INOUT, and OUT parameters
  • Two language handlers, javau (functions not restricted in behavior, only superusers can create them) and java (functions run under a security manager blocking filesystem access, users who can create them configurable with GRANT/REVOKE). For implications of running on Java 17 and later, please see JEP 411.
  • Transaction and Savepoint listeners enabling code execution when a transaction or savepoint is commited or rolled back.

PL/Java earlier supported GCJ, but targets conventional Java virtual machines for current development.

Documentation

The first stop for up-to-date documentation should be the project information site.

You may also find useful information via the wiki links below. Information here will be migrating to the project information site as it is brought up to date.

Installation Guide
User Guide
Contribution Guide

Resources

Note: To be sure of running a current PL/Java, please check the releases page to see what is current. You may check for any prebuilt packages available for your platform. If prebuilt packages are not available for your platform, or if they are behind the current version, please consider Building PL/Java using the source here on GitHub.

The "no longer supported" downloads linked below are quite old and of chiefly historical interest.

Source downloads
Prebuilt packages
No longer supported downloads
Mailing List
Questions tagged pljava on Stack Overflow (Atom feed)
Feed for changes to this wiki itself
Bug Tracking
Older bug tracker at PgFoundry
Even older bug tracker at GBorg

Technology

Technology in Brief
The choice of JNI