Pljava methods to enable Postgresql access to installed Sword modules via the JSword library.
gogsadmin 2739d0f26b Update 'Readme.md' | 11 months ago | |
---|---|---|
lib | 2 years ago | |
src | 2 years ago | |
Readme.md | 11 months ago | |
pljava.policy | 2 years ago | |
pom.xml | 2 years ago |
Build requirements:
On a debian system:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql
See the postgresql documentation for other systems: https://www.postgresql.org/download/
On a debian system:
apt install libpq-dev libkrb5-dev postgresql-server-dev-15 openjdk-17-jdk-headless
git clone https://github.com/tada/pljava.git
git checkout V1_6_6
mvn clean install
See the pljava documentation: https://tada.github.io/pljava/install/install.html
java -jar pljava-packaging/target/pljava-pgX.jar
As postgres user, connect to the database for which you wish to enable pljava extension. In this example, the database is pljavadb
Create role and extension:
CREATE ROLE pljavarole;
CREATE EXTENSION pljava;
Apply ACLs
GRANT USAGE ON LANGUAGE java TO pljavarole;
ALTER DATABASE pljavadb SET pljava.libjvm_location TO '/usr/lib/jvm/java-11-openjdk-arm64/lib/server/libjvm.so';
Dependencies:
pljava
Assuming install location of /home/pljava/bin/
cd ~/pljava-jsword.git
mvn clean package
mkdir ~/bin
cp target/pljava-jsword-0.1.1-SNAPSHOT.jar ~/bin
Copy the slf4j, jdom2 and jsword jar files to ~/bin.
As postgres user, connect to pljavadb
Run SQL:
SELECT sqlj.remove_jar ('slf4j_logger', 'true');
SELECT sqlj.remove_jar ('jsword', 'true');
SELECT sqlj.remove_jar ('jdom2', 'true');
SELECT sqlj.remove_jar ('pljava_jsword', 'true');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/jsword-2.1-SNAPSHOT.jar', 'jsword', 'false');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/slf4j-api-1.7.36.jar', 'slf4j_logger', 'false');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/jdom2-2.0.6.1.jar', 'jdom2', 'false');
SELECT sqlj.set_classpath('public', 'slf4j_logger:jsword:jdom2');
SELECT * FROM sqlj.install_jar('file:///home/pljava/bin/pljava-jsword-0.1.1-SNAPSHOT.jar', 'pljava_jsword', 'true');
SELECT sqlj.set_classpath('public', 'slf4j_logger:jsword:jdom2:pljava_jsword');