Installing Java Stored Procedures on PostgreSQL 8.0 (Win)
February 2005
look at the page PL Java UserGuide, or Deployer documentation.
change the file C:\Program Files\PostgreSQL\8.0\data\postgresql.conf:
dynamic_library_path = '$libdir;C:/Program Files/PostgreSQL/8.0/pljava'
custom_variable_classes = 'pljava'
pljava.classpath = 'C:/Program Files/PostgreSQL/8.0/pljava/pljava.jar'
Set the classpath:
set CLASSPATH=%CLASSPATH%;deploy.jar;..\jdbc\postgresql-8.0.309.jdbc2.jar;pljava.jar
change into directory "Program Files\PostgreSQL\8.0\pljava" and executed
java org.postgresql.pljava.deploy.Deployer -install -database mydatabase -user somesuperuser -password mypasswd
I got the error:
java.sql.SQLException: ERROR: could not load library "C:/Programme/PostgreSQL/8.0/lib/libpljava.dll": dynamic load error
This page helped me a lot:
Debugging PostgreSQL.
runas /user:postgres cmd.exe
postmaster -d 5 -D ../data/
I started postmaster in one command line box, and then psql in another DOS box. That told me that jvm.dll could not be found.
Finally I realised, that the path needs to be set before the postmaster is started.