From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Epiphany/1.6.1 Description of problem: I'm trying to create a function in the "plperl" language. In order to use it in my database, I need to create it in that database. When I try to createlang as the postgres user, I get the following error: [foo@bar ~]$ createlang -U postgres -d baz plperl createlang: language installation failed: ERROR: could not load library "/usr/lib/pgsql/plperl.so": libperl.so: cannot open shared object file: No such file or directory Version-Release number of selected component (if applicable): postgresql-pl-8.0.3-1 How reproducible: Always Steps to Reproduce: 1. createdb -U postgres foo 2. createlang -U postgres -d foo plperl Actual Results: createlang: language installation failed: ERROR: could not load library "/usr/lib/pgsql/plperl.so": libperl.so: cannot open shared object file: No such file or directory Expected Results: No error message and a "0" result code. Additional info: I tried recompiling PostgreSQL from the SRPM on one of the boxes I'm seeing the error on, but that didn't help. I verified the error on my laptop. Plperl did load correctly on an FC2 box I have.
The problem is that the dynamic loader is not finding libperl.so; which is not too amazing because the perl package puts libperl.so in a pretty nonstandard place, such as /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so Ordinarily I'd expect the perl package to have hacked /etc/ld.so.conf to put that directory into the search path, but it seems it doesn't do that. Warren, am I supposed to add an rpath to the plperl.so file to find libperl.so? I thought our packaging policy generally frowns on using rpath. In the meantime, Pete, hacking /etc/ld.so.conf is certainly your best short-term workaround.
Confirmed. This fix works. Adding a file with the path to my libperl.so to a new file in /etc/ld.so.conf.d and running ldconfig fixed the immediate problem. Thanks
Our modern distributions contain explicit symlinks for compatibility with known binary compatible versions of perl, so stuff built with that kind of out-of-the-way RPATH are not likely to break unless the symlinks are explicitly removed in a later version of the perl package. I don't know why it was done this way originally. Maybe to allow multiple versions of perl to be installed simultaneously and avoid links from using the wrong libperl.so? If this is the case, then it probably made sense during the transitions from earlier perl major versions. RPATH to the full path of the libperl.so that was available during build time seems to be what everything else that links against libperl.so does?
rpath added in postgresql-8.0.4-2.FC4.1.