ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu

2017-11-30 Thread Ben Nachtrieb
Hello,

I want to use the perl language in a postgres function.

I am attempting to:
CREATE EXTENSION plperlu

...via pgAdmin 4 connected to postgres 10 and I get this error:
ERROR:  could not load library "/var/lib/pgsql10/lib/postgresql/plperl.so": 
libperl.so: cannot open shared object file: No such file or directory
SQL state: XX000

I look for the library:
find -name libperl.so

...and I see it in these locations:
./usr/lib/perl5/5.18.2/i586-linux-thread-multi/CORE/libperl.so
./usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE/libperl.so

So I conclude that it is already on my server distribution, but isn't in the 
location postgres is looking so I search and find this link:
https://www.postgresql.org/message-id/D960CB61B694CF459DCFB4B0128514C207B2C9DC%40exadv11.host.magwien.gv.at

...and I am opting do this (from the link above, but I have different paths): 
"- Add the directory that contains libperl.so to /etc/ld.so.conf and run 
"ldconfig" as root user. Then start the PostgreSQL server."

So I find the config file:
find -name ld.so.conf

And get this path:
./etc/ld.so.conf

...and edit the file:
vi ./etc/ld.so.conf

... and add this path:
./usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE/

... load the new config:
ldconfig

... restart pg:
systemctl restart postgresql-10.service

... run this query:
CREATE EXTENSION plperlu;

...and get the same error:
ERROR:  could not load library "/var/lib/pgsql10/lib/postgresql/plperl.so": 
libperl.so: cannot open shared object file: No such file or directory
SQL state: XX000

...when I replace the previous path and add this path:
/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE

...to ld.so.conf, I get:
ERROR:  could not load library "/var/lib/pgsql10/lib/postgresql/plperl.so": 
/var/lib/pgsql10/lib/postgresql/plperl.so: undefined symbol: Perl_xs_handshake
SQL state: XX000

... a little different error, but I don't know if I am closer or further away.
How do I get PostgreSQL pointed to the correct library so I can use perl?

I have:

  *   PostgreSQL 10.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 
20120313 (Red Hat 4.4.7-18), 64-bit
  *   pgAdmin 4 2.0
  *   SUSE Linux Enterprise 12 64-bit virtual server

PS - If you prefer Stackoverflow, I asked the exact question here, but haven't 
gotten any traction yet:
https://stackoverflow.com/questions/47578148/error-could-not-load-library-libperl-so-postgresql-trying-to-create-extension

Thanks!
Ben



RE: ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu

2017-11-30 Thread Ben Nachtrieb
Alan,

Thank you!  Solution: build them from source on the server?
Ben
From: Alan Hodgson [mailto:ahodg...@lists.simkin.ca]
Sent: Thursday, November 30, 2017 3:36 PM
To: pgsql-general 
Subject: Re: ERROR: could not load library libperl.so, PostgreSQL trying to 
CREATE EXTENSION plperlu

On Thu, 2017-11-30 at 22:20 +, Ben Nachtrieb wrote:

...to ld.so.conf, I get:
ERROR:  could not load library "/var/lib/pgsql10/lib/postgresql/plperl.so": 
/var/lib/pgsql10/lib/postgresql/plperl.so: undefined symbol: Perl_xs_handshake
SQL state: XX000


It looks to me like your plperl is built against a substantially different 
version of Perl than what you have installed on the server.

I'd guess you installed a PostgreSQL binary built on a different OS version, or 
have otherwise mismatched packages.