Re: stored function (possible to access file system or call java program)?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: stored function (possible to access file system or call java program)?
Date: 2011-10-03 22:09:42
Message-ID: CAHyXU0xA81gU_bj9hVU+P6D5qa6ds41ePyqBLbg9cPsatZHzKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 3, 2011 at 4:53 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:
> On 10/03/11 2:18 PM, Merlin Moncure wrote:
>>
>> hm -- care to comment in more detail?
>
>
> I've had to custom build it for each platform I've deployed it on, and it
> then has dependencies on the exact JDK version and location.   It currently
> doesn't work with JDK 6, only 1.5.    It also requires custom lines be added
> to postgresql.conf and environment variables defined by the postgres service
> startup script.

I don't remember if I did anything special to get this running (I
downloaded the stock .so from pgfoundry), but this is working fine for
me:
merlin(at)mmoncure-ubuntu:~$ ldd /home/merlin/pljava/pljava.so
linux-gate.so.1 => (0x002b2000)
libjvm.so => /usr/lib/libjvm.so (0x00cfc000)
libc.so.6 => /lib/libc.so.6 (0x007db000)
libm.so.6 => /lib/libm.so.6 (0x0075f000)
libdl.so.2 => /lib/libdl.so.2 (0x001b2000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0049a000)

merlin(at)mmoncure-ubuntu:~$ ldd /usr/lib/libjvm.so
linux-gate.so.1 => (0x0029c000)
libm.so.6 => /lib/libm.so.6 (0x0033b000)
libdl.so.2 => /lib/libdl.so.2 (0x00110000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00114000)
libc.so.6 => /lib/libc.so.6 (0x0012e000)

merlin(at)mmoncure-ubuntu:~$ ls -l /usr/lib/libjvm.so
lrwxrwxrwx 1 root root 57 2011-08-12 17:13 /usr/lib/libjvm.so ->
/usr/lib/jvm/java-6-openjdk/jre/lib/i386/server/libjvm.so

also postgres startup script etc is normal -- just the custom .conf
entries, etc. basically, everything was smooth as silk. it looks
like a real bear to compile though if anything goes wrong, I'll admit.

> My first attempt to get it working with 64bit CentOS 6, Sun JDK 1.5.0_22,
> and PG 9.0.5 failed, although I need to start over and make sure I didn't
> mess up a step.

that's (sun) probably the issue. everything's easier on linux i guess.

> The idea of dragging a whole JVM into the process context of the postgres
> server also bothers me, but I must say, that once you DO get it working, the
> developers in another division of $job were able to move some code over from
> Oracle pljava to Postgres pljava without any modifications at all.

yeah -- understood, but especially with the new stuff coming down the
pike for java 7 there are definitely advantages for java shops in
going in this direction...I wouldn't go so far as to say 'integration
nightmare' -- maybe 'situationally dependent difficulties' :-).

merlin

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2011-10-04 00:50:01 Re: stored function (possible to access file system or call java program)?
Previous Message John R Pierce 2011-10-03 21:53:32 Re: stored function (possible to access file system or call java program)?