ok, so progressing. Found that pljava was already part of the Postgres install on OSX. It is under the /Library/Postgres/8.4/lib/postgresql directory
Setting up the environment is proving to be a little tricky. There are many posts explaining that you need a lot of stuff. In the end I needed to add the following three lines to the postgres.conf file, which is in the /Library/Postgres/8.4/data directory. Except that this directory is off limits for users other than postgres. So I sudo to it,
sudo vi postgresql.conf
Once in, I added this at the end of the file:
# PLJava OPTIONS
custom_variable_classes = ‘pljava’
pljava.classpath = ‘/Library/PostgreSQL/8.4/lib/postgresql/pljava.jar’
dynamic_library_path = ‘$libdir:/Library/PostgreSQL/8.4/lib/postgresql’
NB.!!! – Careful of Typos and remember the ” ‘ ”
The docos say to change the LD_LIBRARY_PATH in Linux, but a quick tour of Google showed that this is actually DYLD_LIBRARY_PATH under OSX. However this article seems to indicate that it is not needed, so I left it
Next step is to run the PLJava installer under /Library/PostgresSQL/8.4/share/pljava/pljava.sql. This set up the environment for clients like pgadmin.
Test the install by running
SELECT sqlj.install_jar(‘file:///Library/PostgreSQL/8.4/share/pljava/examples.jar’, ‘samples’, true);
If it works the query will return – install_jar void –
next is to now test the actual java code ….