Extension of official postgres image to include pl/java
2.2K
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:
This docker image contains the standard PostgreSQL docker image with the following packages pre-installed.
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
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.
Content type
Image
Digest
sha256:bf48fa4c5…
Size
257.4 MB
Last updated
about 3 years ago
docker pull beargiles/postgres-pljava