On 9/15/14, Chris Travers <chris.travers@gmail.com> wrote:
> On Sun, Sep 14, 2014 at 10:22 PM, cowwoc <cowwoc@bbs.darktech.org> wrote:
>> Out of curiosity, why is Postgresql's Java support so poor? I am
>> specifically looking for the ability to write triggers in Java.
>
> Because it hasn't been a priority of contributors. This is how
> non-single-vendor open source projects work: people decide what is
> important to them and do the work required. If something gets neglected
> then I guess it wasn't really important.
>> What's going on? Why isn't this a core language supported alongside SQL,
>> Perl and Python as part of the core project?
>
> I have a few questions on this, the answers of which may help answer your
> question:
>
> 1. How well does having a server-side JVM work, resource-wise, when you
> have a forked process model like PostgreSQL? Does having the additional
> JVM's pose performance and competition for resources that lighter languages
> would not?
So eliminate JVM startup overhead by running (one or more
instances of) JVM as a daemon, using nailgun :
http://en.wikipedia.org/wiki/Java_performance#Startup_time
http://martiansoftware.com/nailgun/
For low overhead (trigger) scripts, JVM startup overhead means
order of magnitude(s) slow down - so nailgun means a massive
speedup.
Nailgun does not have multi-user security separation. Although
if this is for a corporate project, adding such security with "Unix
domain sockets" ought be very straightforward (cite is only a private
email discussion I had with nailgun's author some years ago, where
we concluded this should not be difficult to implement per se).
> 2. What is your specific use case for a trigger in Java?
Excellent question.
Good luck,
Zenaan
--
Banned for life from Debian, for suggesting Debian's CoC (Code
of Conduct) is being swung in our faces a little too vigorously.