ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu
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:
/messages/by-id/D960CB61B694CF459DCFB4B0128514C207B2C9DC@exadv11.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
On Thu, 2017-11-30 at 22:20 +0000, 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_handshakeSQL 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.
Show quoted text
Alan,
Thank you! Solution: build them from source on the server?
Ben
From: Alan Hodgson [mailto:ahodgson@lists.simkin.ca]
Sent: Thursday, November 30, 2017 3:36 PM
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: ERROR: could not load library libperl.so, PostgreSQL trying to CREATE EXTENSION plperlu
On Thu, 2017-11-30 at 22:20 +0000, 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.
On Thu, 2017-11-30 at 22:59 +0000, Ben Nachtrieb wrote:
Alan,
Thank you! Solution: build them from source on the server?
Well, it would be more maintainable to find a source for packages built
for your particular OS. Or run a supported OS; that one looks pretty
old.
Or I guess you can build from source.
Show quoted text
On 2017-11-30 15:49:28 -0800, Alan Hodgson wrote:
On Thu, 2017-11-30 at 22:59 +0000, Ben Nachtrieb wrote:
Thank you! Solution: build them from source on the server?Well, it would be more maintainable to find a source for packages built for
your particular OS.
https://www.postgresql.org/download/linux/suse/?
Or run a supported OS; that one looks pretty old.
SLES 12 is the current version of SLES.
hp
--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>