in reply to Cannot load Postgres Shared Object

ld.so is complaining it can't find libpq.so.5 when it's loading the Pg perl module. You need to make sure you have whatever the OS' postgresql package which provides THAT is installed. You can check that it's found correctly by running ldd on the perl module's .so file.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: Cannot load Postgres Shared Object
by markdibley (Sexton) on Oct 27, 2022 at 16:00 UTC

    Postgres was compiled/installed from source files rather than yum. And that installation completed successfully. The libpq.so.5 file was present for the local installation, but the same file was missing file from /usr/lib64. In past server setups that /usr/lib64 version is present.

    I don't know if the yum install of perl(DBI) or perl(DBD::Pg) has installed it in the past (or another package that isn't immediately obvious), but following your advice I found that the following yum install provided the missing files and fixed the problem

    sudo yum install -y postgresql-libs

    Thanks for your help!

      libpq is the C application programmer's interface to PostgreSQL. libpq + is a set of library functions that allow client programs to pass que +ries to the PostgreSQL backend server and to receive the results of t +hese queries. libpq is also the underlying engine for several other PostgreSQL appli +cation interfaces, including those written for C++, Perl, Python, Tcl + and ECPG. So some aspects of libpq's behavior will be important to y +ou if you use one of those packages (from https://www.postgresql.org/ +docs/current/libpq.htm)

      If you installed from source, then it may be that it does not install libpq by default although it's contained in the source, perhaps for doing some testing. Check the makefile targets, perhaps there is one to install libpq.

      For installing Pg with your package manager, it could be that libpq is considered optional (this is what I sensed from cited doc) and therefore it is not bundled with the standard Pg package. In fedora there is a separate libpq package available. And you found the package for your system.