Postgres & PLJava continued

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:

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 ….

1 Comment

  1. I’m looking forward to getting more information about this topic, don’t worry about negative opinions.

Comments RSS TrackBack Identifier URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s