Sign inSign up

beargiles/postgres-pljava

By beargiles

•Updated over 1 year ago

Extension of official postgres image to include pl/java

Image
0

2.2K

beargiles/postgres-pljava repository overview

⁠Overview and Purpose

The pl/java⁠ extension allows static java methods to be used as User-Defined Functions (UDF)⁠. These UDF can be used to create new User-Defined Types (UDT)⁠.

This extension does not support:

  • Foreign Data Wrappers (FDW)
  • (Java) Procedural Language

⁠Contents

This docker image contains the standard PostgreSQL docker image with the following packages pre-installed.

⁠Configuration

See the upstream image (/https://hub.docker.com/_/postgres⁠) for database configuration details.

The PL/Java extension has already been installed so you can go straight to installing one or more jar files. For instance

-- install jar
SELECT sqlj.install_jar(
  'file:'
  '/buildroot/pljava-examples/target/pljava-examples-1.6.5.jar',
  'examples', true);

-- associate jar with classpath
SELECT sqlj.set_classpath('javatest', 'examples');

-- use new UTF
SELECT javatest.java_addone(3);

For more examples see PL/java examples⁠

⁠Functional Tests using TestContainers

You must use the following code snippet to use this image with recent versions of Test Containers homepage⁠

    PostgreSQLContainer getContainer() {
        DockerImageName imageName = DockerImageName.parse("beargiles/postgres-pgxnclient:15.3").asCompatibleSubstituteFor("postgres");
        PostgreSQLContainer db = new PostgreSQLContainer(ImageName);
        db.withImagePullPolicy((s) -> false);
        return db;
    }

The withImagePull() provides hints on where to find the docker image. It's required on my dev machine but that may be specific to my system.

⁠Additional Resources

⁠See Also

Tag summary

Content type

Image

Digest

sha256:bf48fa4c5…

Size

257.4 MB

Last updated

about 3 years ago

docker pull beargiles/postgres-pljava