postgresqlopensusezypper

libpq.so not in `pg_config --libdir` path [OpenSUSE]


As the title says, the library libpq.so is not in the path given by pg_config --libdir. I install postgresql posqtgresql-devel which provides the package libpq5 which in turn installs the libpq.so.

    $ pg_config --libdir
    /usr/lib/postgresql10/lib64
    $ find /usr/ -name libpq.so
    /usr/lib64/libpq.so

Our applications rely on the path given by pg_config --libdir to look for libpq.so but it fails. Is this some problem with OpenSUSE package management or is it that we shouldn't be using pg_config for this purpose?


Solution

  • pg_config provides information about how PostgreSQL was built.

    It is usually used to build server extensions, but it should also work with client code like you are trying to do.

    Since your PostgreSQL is installed in a path that contains the version, but your libpq.so is not, I'd assume that the latter is a symbolic link rather than being part of the installation package.

    If there is no libpq.so in your PostgreSQL lib directory, I'd call that a packaging error. You should discuss that with the packagers.