I'm making some functions in postgres using the plperl extention, and I'm having trouble getting everything set up right. I should say to begin with that I am not a C coder, so my level of understanding regarding perl.h and linking issues is pretty low.

To begin with, plperl requires a shared libperl, which perl's Configure tells me can slow down performance. My sollution was to install two perls. This got me part way there. However, it wouldn't compile, and after looking at perl.h and EXTERN.h, I fixed it with a s/errgv/PL_errgv/g and a s/\bna\b/PL_na/g on plperl.c. Which brings us to my first question:

(1) Is this an issue regarding perl version numbers? (I'm using 5.6.0) Is this something I should worry about, or am I just the only person crazy enough to try to compile plperl?

Okay, so then I was able to make plperl, and do a createlang on my database. So far so good. Except that when I try to actually install a plperl function in the database, it gave me an error that it couldn't find libperl.so. This was quite a surprise to me as I had already set LD_LIBRARY_PATH so that it could find it to link plperl.so. So, my next question is:

(2) Is this most likely an issue with perl, plperl, or postgres?

I was able to get it to work by copying libperl.so to /usr/lib, but that is really not where I want it. Which brings us to the important one of my questions, which is:

(3) Will this slow down my existing perl programs and modules, or will this new libperl only get used if I install new modules that are not pure Perl? And, the potentially "noticable effect on performance" mentioned in perl's Configure, what specific aspects of performance would take a hit? This is very important to me in determining if my workarounds are going to be reasonable in a production environment. ie, if performance hit is acceptable, then I'll not be worried about new addons using the shared libperl. I could do some benchmarking, but I don't know what I should be benchmarking...

Thank you,
Paris


In reply to libperl.so woes by Aighearach

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.